55
55
56
56
/**
57
57
* @callback TxCreate
58
- * @param {TxDeps } myUtils
58
+ * @param {TxDeps } keyUtils
59
59
* @returns {tx }
60
60
*/
61
61
@@ -230,10 +230,10 @@ var DashTx = ("object" === typeof module && exports) || {};
230
230
return sats ;
231
231
} ;
232
232
233
- Tx . create = function ( myUtils ) {
233
+ Tx . create = function ( _keyUtils ) {
234
234
let txInst = { } ;
235
235
236
- txInst . _utils = Object . assign ( { } , Tx . utils , myUtils ) ;
236
+ txInst . _utils = Object . assign ( { } , Tx . utils , _keyUtils ) ;
237
237
238
238
/** @type {TxHashAndSignAll } */
239
239
txInst . hashAndSignAll = async function ( txInfo , keys ) {
@@ -746,11 +746,11 @@ var DashTx = ("object" === typeof module && exports) || {};
746
746
} ;
747
747
748
748
/**
749
- * @param {TxDeps } myUtils
749
+ * @param {TxDeps } keyUtils
750
750
* @param {Array<TxPrivateKey> } keys
751
751
*/
752
- Tx . _createKeyUtils = function ( myUtils , keys ) {
753
- let _getPublicKey = myUtils . getPublicKey || getPublicKey ;
752
+ Tx . _createKeyUtils = function ( keyUtils , keys ) {
753
+ let _getPublicKey = keyUtils . getPublicKey || getPublicKey ;
754
754
let _utils = {
755
755
/** @type {TxGetPrivateKey } */
756
756
getPrivateKey : async function ( _ , i ) {
@@ -759,16 +759,16 @@ var DashTx = ("object" === typeof module && exports) || {};
759
759
} ,
760
760
/** @type {TxGetPublicKey } */
761
761
getPublicKey : _getPublicKey ,
762
- sign : myUtils . sign ,
762
+ sign : keyUtils . sign ,
763
763
} ;
764
764
765
765
/** @type {TxGetPublicKey } */
766
766
async function getPublicKey ( txInput , i , txInputs ) {
767
767
let privKey = keys [ i ] ;
768
- if ( ! myUtils . toPublicKey ) {
768
+ if ( ! keyUtils . toPublicKey ) {
769
769
throw new Error ( "type assert: missing 'toPublicKey'" ) ;
770
770
}
771
- let pubKey = myUtils . toPublicKey ( privKey ) ;
771
+ let pubKey = keyUtils . toPublicKey ( privKey ) ;
772
772
if ( "string" === typeof pubKey ) {
773
773
console . warn (
774
774
"oops, you gave a publicKey as hex (deprecated) rather than a buffer" ,
@@ -778,7 +778,7 @@ var DashTx = ("object" === typeof module && exports) || {};
778
778
return pubKey ;
779
779
}
780
780
781
- return Object . assign ( _utils , myUtils ) ;
781
+ return Object . assign ( _utils , keyUtils ) ;
782
782
} ;
783
783
784
784
/**
@@ -903,7 +903,7 @@ var DashTx = ("object" === typeof module && exports) || {};
903
903
* TODO _param {Array<TxOutput>} txInfo.outputs
904
904
* TODO _param {Uint32} [txInfo.version]
905
905
* TODO _param {Boolean} [txInfo._debug] - bespoke debug output
906
- * @param {TxDeps } myUtils
906
+ * @param {TxDeps } keyUtils
907
907
* @returns {Promise<TxInfoSigned> }
908
908
*/
909
909
Tx . _hashAndSignAll = async function ( txInfo , keyUtils ) {
@@ -937,6 +937,8 @@ var DashTx = ("object" === typeof module && exports) || {};
937
937
inputs : [ ] ,
938
938
outputs : txInfo . outputs ,
939
939
version : txInfo . version || CURRENT_VERSION ,
940
+ locktime : txInfo . locktime || 0x00 ,
941
+ transaction : "" ,
940
942
} ;
941
943
942
944
// temp shim
0 commit comments