Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fix privKeyBytes typos #58

Merged
merged 2 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ let keyUtils = {

toPublicKey: async function (privKeyBytes) {
let isCompressed = true;
let pubKeyBytes = Secp256k1.getPublicKey(privateKey, isCompressed);
let pubKeyBytes = Secp256k1.getPublicKey(privKeyBytes, isCompressed);

return pubKeyBytes;
},
Expand Down Expand Up @@ -231,9 +231,9 @@ console.info(txInfo.transaction);

```js
// "XJREPzkMSHobz6kpxKd7reMiWr3YoyTdaj3sJXLGCmiDHaL7vmaQ"
let privateKeyHex =
let privKeyHex =
"d4c569f71ea2a9be6010cb3691f2757bc9539c60fd87e8bed21d7844d7b9b246";
let privateKey = Tx.utils.hexToBytes(privateKeyHex);
let privKeyBytes = Tx.utils.hexToBytes(privKeyHex);

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

async function toPublicKey(privKeyBytes) {
let isCompressed = true;
let pubKeyBytes = Secp256k1.getPublicKey(privateKey, isCompressed);
let pubKeyBytes = Secp256k1.getPublicKey(privKeyBytes, isCompressed);
return pubKeyBytes;
}
```
Expand Down
2 changes: 1 addition & 1 deletion dashtx.js
Original file line number Diff line number Diff line change
Expand Up @@ -1927,7 +1927,7 @@ if ("object" === typeof module) {
/**
* @callback TxToPublicKey
* @param {TxPrivateKey} privateKey - buf
* @returns {TxPublicKey} - public key buf
* @returns {Promise<TxPublicKey>} - public key buf
*/

/**
Expand Down
Loading