Skip to content

Commit 3d47f5d

Browse files
author
AJ ONeal
committed
ref!: hdkey as pure object
1 parent c551cca commit 3d47f5d

File tree

3 files changed

+296
-237
lines changed

3 files changed

+296
-237
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ console.log(hdkey.privateExtendedKey);
6262

6363
// => 'xprv9s21ZrQH143K2SKJK9EYRW3Vsg8tWVHRS54hAJasj1eGsQXeWDHLeuu5hpLHRbeKedDJM4Wj9wHHMmuhPF8dQ3bzyup6R7qmMQ1i1FtzNEW'
6464

65-
var xpub = await hdkey.getPublicExtendedKey();
65+
var xpub = await DashHd.getPublicExtendedKey(hdkey);
6666
console.log(xpub);
6767
// => 'xpub661MyMwAqRbcEvPmRAmYndzERhyNux1GoHzHxgzVHMBFkCro3kbbCiDZZ5XabZDyXPj5mH3hktvkjhhUdCQxie5e1g4t2GuAWNbPmsSfDp2'
6868
```
@@ -101,7 +101,7 @@ var hdkey = DashHd.fromExtendedKey(key);
101101

102102
---
103103

104-
### `await hdkey.derive(path)`
104+
### `await DashHd.derive(hdkey, path)`
105105

106106
Derives the `hdkey` at `path` from the current `hdkey`.
107107

@@ -111,11 +111,11 @@ var seed =
111111
var hdkey = await DashHd.fromMasterSeed(Buffer.from(seed, "hex"));
112112
var childkey = await hdkey.derive("m/0/2147483647'/1");
113113

114-
var xprv = await childkey.getPrivateExtendedKey();
114+
var xprv = await DashHd.getPrivateExtendedKey(childkey);
115115
console.log(xprv);
116116
// -> "xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef"
117117

118-
var xpub = await childkey.getPublicExtendedKey();
118+
var xpub = await DashHd.getPublicExtendedKey(childkey);
119119
console.log(xpub);
120120
// -> "xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon"
121121
```
@@ -127,25 +127,25 @@ Newer, "hardened" derivation paths look like this:
127127
var childkey = await hdkey.derive("m/44'/0'/0'/0/0");
128128
```
129129

130-
### `hdkey.wipePrivateData()`
130+
### `DashHd.wipePrivateData(hdkey)`
131131

132132
Wipes all record of the private key from the `hdkey` instance. After calling
133133
this method, the instance will behave as if it was created via
134134
`DashHd.fromExtendedKey(xpub)`.
135135

136-
### `hdkey.getPrivateKey()`
136+
### `hdkey.privateKey`
137137

138138
Get the `hdkey`'s private key, stored as a buffer.
139139

140140
### `hdkey.publicKey`
141141

142142
Get the `hdkey`'s public key, stored as a buffer.
143143

144-
### `await hdkey.getPrivateExtendedKey()`
144+
### `await DashHd.getPrivateExtendedKey(hdkey)`
145145

146146
Get the `hdkey`'s `xprv`, stored as a string.
147147

148-
### `await hdkey.getPublicExtendedKey()`
148+
### `await DashHd.getPublicExtendedKey(hdkey)`
149149

150150
Get the `hdkey`'s `xpub`, stored as a string.
151151

0 commit comments

Comments
 (0)