@@ -299,22 +299,9 @@ async function main() {
299
299
let dashTx = DashTx . create ( keyUtils ) ;
300
300
301
301
// dash-cli -testnet getaddressutxos '{"addresses":["yT6GS8qPrhsiiLHEaTWPYJMwfPPVt2SSFC"]}'
302
- // TODO see https://github.com/dashhive/DashKeys.js/issues/26
303
- //let collateralAddr = DashKeys.wifToAddr(collateralWif, {
304
- let collateralParts = await DashKeys . decode ( collateralWif , {
305
- version : "ef" ,
306
- validate : true ,
307
- } ) ;
308
- let collateralPrivBytes = DashKeys . utils . hexToBytes (
309
- //@ts -ignore - bad types internally
310
- collateralParts . privateKey ,
311
- ) ;
312
- let collateralPubBytes =
313
- await DashKeys . utils . toPublicKey ( collateralPrivBytes ) ;
314
- let collateralAddr = await DashKeys . pubkeyToAddr ( collateralPubBytes , {
302
+ let collateralAddr = await DashKeys . wifToAddr ( collateralWif , {
315
303
version : "testnet" ,
316
304
} ) ;
317
- // end testnet workaround
318
305
319
306
console . log ( "" ) ;
320
307
console . log ( "Collateral Address (source of 1 DASH network fee):" ) ;
@@ -348,14 +335,13 @@ async function main() {
348
335
txid = await DashTx . getId ( txInfoSigned . transaction ) ;
349
336
console . log ( txid ) ;
350
337
351
- //console.log(DashGov.PROPOSAL_FEE_RATE);
352
- let txResult = await rpc . request ( "/" , {
353
- method : "sendrawtransaction" ,
354
- params : [ txInfoSigned . transaction ] ,
355
- } ) ;
356
- console . log ( "" ) ;
357
- console . log ( "Transaction sent:" ) ;
358
- console . log ( txResult ) ;
338
+ let txResult = await rpc . request ( "/" , {
339
+ method : "sendrawtransaction" ,
340
+ params : [ txInfoSigned . transaction ] ,
341
+ } ) ;
342
+ console . log ( "" ) ;
343
+ console . log ( "Transaction sent:" ) ;
344
+ console . log ( txResult ) ;
359
345
}
360
346
361
347
for ( ; ; ) {
0 commit comments