|
8 | 8 | * @prop {Uint32} MAX_INPUT_PAD - 2 (possible ASN.1 BigInt padding)
|
9 | 9 | * @prop {Uint32} MAX_INPUT_SIZE - 149 each (with padding)
|
10 | 10 | * @prop {Uint32} OUTPUT_SIZE - 34 each
|
11 |
| - * @prop {Uint32} SIGHASH_ALL - 0x01 |
| 11 | + * @prop {Uint32|0x00000001} SIGHASH_ALL - 0x01 |
| 12 | + * @prop {Uint32|0x00000080} SIGHASH_ANYONECANPAY - 0x80 |
12 | 13 | * @prop {TxAppraise} appraise
|
13 | 14 | * @prop {TxAppraiseCounts} _appraiseCounts
|
14 | 15 | * @prop {TxAppraiseMemos} _appraiseMemos
|
|
22 | 23 | * @prop {TxGetId} getId - only useful for fully signed tx
|
23 | 24 | * @prop {TxHashPartial} hashPartial - useful for computing sigs
|
24 | 25 | * @prop {TxCreateLegacyTx} createLegacyTx
|
| 26 | + * @prop {TxParseUnknown} parseUnknown |
| 27 | + * @prop {TxParseRequest} parseRequest |
| 28 | + * @prop {TxParseHashable} parseHashable |
| 29 | + * @prop {TxParseSigned} parseSigned |
25 | 30 | * @prop {TxSortBySats} sortBySatsAsc
|
26 | 31 | * @prop {TxSortBySats} sortBySatsDsc
|
27 | 32 | * @prop {TxSortInputs} sortInputs
|
|
32 | 37 | * @prop {Function} _create
|
33 | 38 | * @prop {Function} _createInsufficientFundsError
|
34 | 39 | * @prop {Function} _createMemoScript
|
| 40 | + * @prop {Function} _debugPrint |
35 | 41 | * @prop {Function} _hash
|
36 | 42 | * @prop {Function} _hashAndSignAll
|
37 | 43 | * @prop {Function} _legacyMustSelectInputs
|
38 | 44 | * @prop {Function} _legacySelectOptimalUtxos
|
39 | 45 | * @prop {Function} _packInputs
|
40 | 46 | * @prop {Function} _packOutputs
|
| 47 | + * @prop {Function} _parse |
41 | 48 | */
|
42 | 49 |
|
43 | 50 | /**
|
@@ -153,6 +160,7 @@ var DashTx = ("object" === typeof module && exports) || {};
|
153 | 160 | 25; // lockscript
|
154 | 161 |
|
155 | 162 | Tx.SIGHASH_ALL = 0x01;
|
| 163 | + Tx.SIGHASH_ANYONECANPAY = 0x80; |
156 | 164 |
|
157 | 165 | Tx.appraise = function (txInfo) {
|
158 | 166 | let extraSize = Tx._appraiseMemos(txInfo.outputs);
|
@@ -1368,8 +1376,8 @@ var DashTx = ("object" === typeof module && exports) || {};
|
1368 | 1376 | let sigHashTypeHex = TxUtils._toUint32LE(sigHashType);
|
1369 | 1377 | txSignable = `${txSignable}${sigHashTypeHex}`;
|
1370 | 1378 | }
|
1371 |
| - //console.log("Signable Tx Hex"); |
1372 |
| - //console.log(txSignable); |
| 1379 | + console.log("Signable Tx Hex"); |
| 1380 | + console.log(txSignable); |
1373 | 1381 |
|
1374 | 1382 | let u8 = Tx.utils.hexToBytes(txSignable);
|
1375 | 1383 | //console.log("Signable Tx Buffer");
|
@@ -1609,9 +1617,10 @@ if ("object" === typeof module) {
|
1609 | 1617 | // Type Aliases
|
1610 | 1618 |
|
1611 | 1619 | /** @typedef {Number} Float64 */
|
1612 |
| -/** @typedef {Number} Uint53 */ |
1613 |
| -/** @typedef {Number} Uint32 */ |
1614 | 1620 | /** @typedef {Number} Uint8 */
|
| 1621 | +/** @typedef {Number} Uint32 */ |
| 1622 | +/** @typedef {Number} Uint53 */ |
| 1623 | +/** @typedef {String} Hex */ |
1615 | 1624 | /** @typedef {Uint8Array} TxPrivateKey */
|
1616 | 1625 | /** @typedef {Uint8Array} TxPublicKey */
|
1617 | 1626 | /** @typedef {Uint8Array} TxSignature */
|
@@ -1878,6 +1887,30 @@ if ("object" === typeof module) {
|
1878 | 1887 | * @returns {Promise<TxInfo>}
|
1879 | 1888 | */
|
1880 | 1889 |
|
| 1890 | +/** |
| 1891 | + * @callback TxParseRequest |
| 1892 | + * @param {Hex} hex - a tx request with unsigned or partially signed inputs |
| 1893 | + * @returns {TxInfo} |
| 1894 | + */ |
| 1895 | + |
| 1896 | +/** |
| 1897 | + * @callback TxParseHashable |
| 1898 | + * @param {Hex} hex - a ready-to-sign tx with input script and trailing sighash byte |
| 1899 | + * @returns {TxInfo} |
| 1900 | + */ |
| 1901 | + |
| 1902 | +/** |
| 1903 | + * @callback TxParseSigned |
| 1904 | + * @param {Hex} hex - a fully signed, ready-to-broadcast transaction |
| 1905 | + * @returns {TxInfo} |
| 1906 | + */ |
| 1907 | + |
| 1908 | +/** |
| 1909 | + * @callback TxParseUnknown |
| 1910 | + * @param {Hex} hex - a tx request, hashable tx, or signed tx |
| 1911 | + * @returns {TxInfo} |
| 1912 | + */ |
| 1913 | + |
1881 | 1914 | /**
|
1882 | 1915 | * @callback TxReverseHex
|
1883 | 1916 | * @param {String} hex
|
|
0 commit comments