优化 seed2path
This commit is contained in:
parent
73c33e3175
commit
4a43057f3c
6
index.js
6
index.js
@ -463,15 +463,15 @@ class TICrypto {
|
|||||||
let part3 = parseInt(hash.slice(18, 24), 16)
|
let part3 = parseInt(hash.slice(18, 24), 16)
|
||||||
let part4 = parseInt(hash.slice(24, 30), 16)
|
let part4 = parseInt(hash.slice(24, 30), 16)
|
||||||
let path = `${part0}'/${part1}/${part2}/${part3}/${part4}/${part5}`
|
let path = `${part0}'/${part1}/${part2}/${part3}/${part4}/${part5}`
|
||||||
if (coin) coin = coin.toUpperCase()
|
switch (coin.toUpperCase()) {
|
||||||
switch (coin) {
|
|
||||||
case 'BTC':
|
case 'BTC':
|
||||||
return `m/44'/0'/${path}`
|
return `m/44'/0'/${path}`
|
||||||
case 'ETH':
|
case 'ETH':
|
||||||
return `m/44'/60'/${path}`
|
return `m/44'/60'/${path}`
|
||||||
case 'TIC':
|
case 'TIC':
|
||||||
default:
|
|
||||||
return `m/44'/60000'/${path}`
|
return `m/44'/60000'/${path}`
|
||||||
|
default:
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user