@@ -177,7 +177,7 @@ let keyUtils = {
177
177
178
178
toPublicKey : async function (privKeyBytes ) {
179
179
let isCompressed = true ;
180
- let pubKeyBytes = Secp256k1 .getPublicKey (privateKey , isCompressed);
180
+ let pubKeyBytes = Secp256k1 .getPublicKey (privKeyBytes , isCompressed);
181
181
182
182
return pubKeyBytes;
183
183
},
@@ -231,9 +231,9 @@ console.info(txInfo.transaction);
231
231
232
232
``` js
233
233
// "XJREPzkMSHobz6kpxKd7reMiWr3YoyTdaj3sJXLGCmiDHaL7vmaQ"
234
- let privateKeyHex =
234
+ let privKeyHex =
235
235
" d4c569f71ea2a9be6010cb3691f2757bc9539c60fd87e8bed21d7844d7b9b246" ;
236
- let privateKey = Tx .utils .hexToBytes (privateKeyHex );
236
+ let privKeyBytes = Tx .utils .hexToBytes (privKeyHex );
237
237
238
238
let publicKeyHex =
239
239
" 03755be68d084e7ead4d83e23fb37c3076b16ead432de1b0bdf249290400f263cb" ;
@@ -611,7 +611,7 @@ let Secp256k1 =
611
611
*
612
612
* We recommend @dashincubator/secp256k1 and @noble/secp256k1.
613
613
*
614
- * @param {Uint8Array} privateKey - an input's corresponding key
614
+ * @param {Uint8Array} privKeyBytes - an input's corresponding key
615
615
* @param {Uint8Array} txHashBytes - the (not reversed) 2x-sha256-hash
616
616
* @returns {String} - hex representation of an ASN.1 signature
617
617
*/
@@ -624,7 +624,7 @@ async function sign(privKeyBytes, txHashBytes) {
624
624
625
625
async function toPublicKey (privKeyBytes ) {
626
626
let isCompressed = true ;
627
- let pubKeyBytes = Secp256k1 .getPublicKey (privateKey , isCompressed);
627
+ let pubKeyBytes = Secp256k1 .getPublicKey (privKeyBytes , isCompressed);
628
628
return pubKeyBytes;
629
629
}
630
630
```
0 commit comments