From 45f748afb6d5f0f151f517c5497be0b2f4ac5d2c Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Thu, 23 Sep 2021 10:15:18 +0800 Subject: [PATCH] add support for EXT coin --- index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index c4b33fb..72e6dd2 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ my.OUTPUT_LIST = ['hex', 'latin1', 'base64'] // or 'buf' to Buffer explicitly my.INPUT = 'utf8' // 默认的加密方法的明文格式。utf8 能够兼容 latin1, ascii 的情形 my.INPUT_LIST = ['utf8', 'ascii', 'latin1'] // ignored for Buffer/TypedArray/DataView my.COIN = 'TIC' // 默认的币种 -my.COIN_LIST = ['TIC', 'BTC', 'ETH'] +my.COIN_LIST = ['TIC', 'EXT', 'BTC', 'ETH'] /** * @@ -432,6 +432,9 @@ class TICrypto { case 'ETH': key = hdmaster.derive("m/44'/60'/0'/0/0") break + case 'EXT': + key = hdmaster.derive("m/44'/60398'/0'/0/0") + break case 'TIC': default: key = hdmaster.derive("m/44'/60000'/0'/0/0") @@ -478,10 +481,11 @@ class TICrypto { return `m/44'/0'/${path}` case 'ETH': return `m/44'/60'/${path}` + case 'EXT': + return `m/44'/60398'/${path}` case 'TIC': - return `m/44'/60000'/${path}` default: - return '' + return `m/44'/60000'/${path}` } }