Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const headers = []
for (var i = 0; i < props.length; i++) {
headers.push(headerKeys[props[i]])
}
const result = [['account', ...headers]]
for (var i = start; i < end; i++) {
const wallet = hdwallet.derive(i)
const values = []
for (var j = 0; j < props.length; j++) {
const prop = props[j]
var value = null
if (prop === 'address') {
value = toChecksumAddress('0x' + wallet.getAddress().toString('hex'))
} else if (prop === 'private') {
value = wallet.getPrivateKey().toString('hex')
} else if (prop === 'public') {
value = wallet.getPublicKey().toString('hex')
} else if (prop === 'hdpath') {
value = wallet.hdpath()
}
if (value) {
values.push(value)
}
}
result.push([
i,
...values