Skip to content

Commit 83175c6

Browse files
committed
doc: fix getPrivateKey() example (missing async, typo of bytes)
1 parent 9d6bd29 commit 83175c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,13 @@ toPublicKey(privKeyBytes)
152152
```js
153153
let keyUtils = {
154154
getPrivateKey: async function (txInput, i) {
155+
let opts = { version: "mainnet" };
155156
let pkhBytes = DashKeys.utils.hexToBytes(txInput.pubKeyHash);
156-
let address = await DashKeys.pkhToAddr(txInput.pubKeyHash);
157+
let address = await DashKeys.pkhToAddr(pkhBytes, opts);
157158

158159
let yourKeyData = yourWalletKeyMapGoesHere[address];
159160

160-
let privKeyBytes = DashKeys.wifToPrivKey(yourKeyData.wif);
161+
let privKeyBytes = await DashKeys.wifToPrivKey(yourKeyData.wif, opts);
161162
return privKeyBytes;
162163
},
163164

0 commit comments

Comments
 (0)