generated from web3w/hd-address
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseed.js
29 lines (26 loc) · 994 Bytes
/
seed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
const hdAddress = require("hd-address")
let hdIndex = 6677
const myselfSeed = "03d0be996b63e90c7625dd3f5319c3bc11669d3d35ae5dc345595e5e59be74084f"
// 16(128bits)< seed.length<64(512bits)
let example = async () => {
let seedBuf = Buffer.from(myselfSeed, "hex")
let hd = hdAddress.HD(seedBuf, hdAddress.keyType.seed)
let addr = hd.BTC.getAddress(hdIndex)
console.log("BTC", addr.address)
addr = hd.BTC_TEST.getAddress(hdIndex)
console.log("BTC_TEST", addr.address)
addr = hd.BCH.getAddress(hdIndex)
console.log("BCH", addr.address)
addr = hd.BCH_TEST.getAddress(hdIndex)
console.log("BCH_TEST", addr.address)
addr = hd.LTC.getAddress(hdIndex)
console.log("LTC", addr.address)
addr = hd.LTC_TEST.getAddress(hdIndex)
console.log("LTC_TEST", addr.address)
addr = hd.ETH.getAddress(hdIndex)
console.log("ETH", addr.address)
addr = hd.TRX.getAddress(hdIndex)
console.log("TRX", addr.address)
}
example()