@@ -1153,7 +1153,7 @@ var DashTx = ("object" === typeof module && exports) || {};
1153
1153
void Tx . serializeInputs ( inputs , { _tx : tx , _sep : _sep } ) ;
1154
1154
void Tx . serializeOutputs ( outputs , { _tx : tx , _sep : _sep } ) ;
1155
1155
1156
- let locktimeHex = TxUtils . _toUint32LE ( locktime ) ;
1156
+ let locktimeHex = TxUtils . toUint32LE ( locktime ) ;
1157
1157
tx . push ( locktimeHex ) ;
1158
1158
1159
1159
if ( extraPayload ) {
@@ -1165,7 +1165,7 @@ var DashTx = ("object" === typeof module && exports) || {};
1165
1165
let txHex = tx . join ( _sep ) ;
1166
1166
1167
1167
if ( sigHashType ) {
1168
- let sigHashTypeHex = TxUtils . _toUint32LE ( sigHashType ) ;
1168
+ let sigHashTypeHex = TxUtils . toUint32LE ( sigHashType ) ;
1169
1169
txHex = `${ txHex } ${ sigHashTypeHex } ` ;
1170
1170
}
1171
1171
@@ -1215,7 +1215,7 @@ var DashTx = ("object" === typeof module && exports) || {};
1215
1215
`expected utxo property 'input[${ i } ]outputIndex' to be an integer representing this input's previous output index` ,
1216
1216
) ;
1217
1217
}
1218
- let reverseVout = TxUtils . _toUint32LE ( voutIndex ) ;
1218
+ let reverseVout = TxUtils . toUint32LE ( voutIndex ) ;
1219
1219
tx . push ( reverseVout ) ;
1220
1220
1221
1221
//@ts -ignore - enum types not handled properly here
@@ -1817,12 +1817,12 @@ var DashTx = ("object" === typeof module && exports) || {};
1817
1817
1818
1818
//@ts -ignore
1819
1819
if ( n <= MAX_U16 ) {
1820
- return "fd" + TxUtils . _toUint32LE ( n ) . slice ( 0 , 4 ) ;
1820
+ return "fd" + TxUtils . toUint32LE ( n ) . slice ( 0 , 4 ) ;
1821
1821
}
1822
1822
1823
1823
//@ts -ignore
1824
1824
if ( n <= MAX_U32 ) {
1825
- return "fe" + TxUtils . _toUint32LE ( n ) ;
1825
+ return "fe" + TxUtils . toUint32LE ( n ) ;
1826
1826
}
1827
1827
1828
1828
//@ts -ignore
@@ -1850,7 +1850,7 @@ var DashTx = ("object" === typeof module && exports) || {};
1850
1850
* which is true in practice, and much simpler.
1851
1851
* @param {BigInt|Number } n - 32-bit positive int to encode
1852
1852
*/
1853
- TxUtils . _toUint32LE = function ( n ) {
1853
+ TxUtils . toUint32LE = function ( n ) {
1854
1854
// make sure n is uint32/int53, not int32
1855
1855
//n = n >>> 0;
1856
1856
@@ -1860,14 +1860,21 @@ var DashTx = ("object" === typeof module && exports) || {};
1860
1860
let hexLE = Tx . utils . reverseHex ( hex ) ;
1861
1861
return hexLE ;
1862
1862
} ;
1863
+ //@ts -ignore
1864
+ TxUtils . _toUint32LE = function ( n ) {
1865
+ console . warn (
1866
+ "warn: use public TxUtils.toUint32LE() instead of internal TxUtils._toUint32LE()" ,
1867
+ ) ;
1868
+ return TxUtils . toUint32LE ( n ) ;
1869
+ } ;
1863
1870
1864
1871
/**
1865
1872
* Just assumes that all target CPUs are Little-Endian,
1866
1873
* which is true in practice, and much simpler.
1867
1874
* @param {BigInt|Number } n - 16-bit positive int to encode
1868
1875
*/
1869
1876
TxUtils . _toUint16LE = function ( n ) {
1870
- let hexLE = TxUtils . _toUint32LE ( n ) ;
1877
+ let hexLE = TxUtils . toUint32LE ( n ) ;
1871
1878
// ex: 03000800 => 0300
1872
1879
hexLE = hexLE . slice ( 0 , 4 ) ;
1873
1880
return hexLE ;
0 commit comments