Skip to content

Commit 6030f3d

Browse files
committed
doc: fix typo privKeyBytes
1 parent a0324a8 commit 6030f3d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ let keyUtils = {
177177

178178
toPublicKey: async function (privKeyBytes) {
179179
let isCompressed = true;
180-
let pubKeyBytes = Secp256k1.getPublicKey(privateKey, isCompressed);
180+
let pubKeyBytes = Secp256k1.getPublicKey(privKeyBytes, isCompressed);
181181

182182
return pubKeyBytes;
183183
},
@@ -231,9 +231,9 @@ console.info(txInfo.transaction);
231231

232232
```js
233233
// "XJREPzkMSHobz6kpxKd7reMiWr3YoyTdaj3sJXLGCmiDHaL7vmaQ"
234-
let privateKeyHex =
234+
let privKeyHex =
235235
"d4c569f71ea2a9be6010cb3691f2757bc9539c60fd87e8bed21d7844d7b9b246";
236-
let privateKey = Tx.utils.hexToBytes(privateKeyHex);
236+
let privKeyBytes = Tx.utils.hexToBytes(privKeyHex);
237237

238238
let publicKeyHex =
239239
"03755be68d084e7ead4d83e23fb37c3076b16ead432de1b0bdf249290400f263cb";
@@ -611,7 +611,7 @@ let Secp256k1 =
611611
*
612612
* We recommend @dashincubator/secp256k1 and @noble/secp256k1.
613613
*
614-
* @param {Uint8Array} privateKey - an input's corresponding key
614+
* @param {Uint8Array} privKeyBytes - an input's corresponding key
615615
* @param {Uint8Array} txHashBytes - the (not reversed) 2x-sha256-hash
616616
* @returns {String} - hex representation of an ASN.1 signature
617617
*/
@@ -624,7 +624,7 @@ async function sign(privKeyBytes, txHashBytes) {
624624

625625
async function toPublicKey(privKeyBytes) {
626626
let isCompressed = true;
627-
let pubKeyBytes = Secp256k1.getPublicKey(privateKey, isCompressed);
627+
let pubKeyBytes = Secp256k1.getPublicKey(privKeyBytes, isCompressed);
628628
return pubKeyBytes;
629629
}
630630
```

0 commit comments

Comments
 (0)