From 7ac41c9f32c13e8ce7c5a769955634edc841c1b8 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Wed, 16 Jun 2021 11:09:20 +0800 Subject: [PATCH] =?UTF-8?q?buf=20fix:=20=E6=8A=8A=20options=20=E6=8D=A2?= =?UTF-8?q?=E6=88=90=20{...}=20=E5=86=99=E6=B3=95=E5=90=8E=EF=BC=8Csecword?= =?UTF-8?q?2address=20=E6=B2=A1=E8=83=BD=E6=8A=8A=20world=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=A0=E9=80=92=E5=88=B0=20position2address?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E7=94=9F=E6=88=90=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 6368909..3e99c26 100644 --- a/index.js +++ b/index.js @@ -518,15 +518,15 @@ class TICrypto { * @return {String} address * @memberof TICrypto */ - static secword2address(secword, { coin, pass, path, tool, hasher } = {}) { + static secword2address(secword, { coin, world, pass, path, tool, hasher } = {}) { coin = my.COIN_LIST.indexOf(coin?.toUpperCase()) >= 0 ? coin.toUpperCase() : my.COIN let kp = this.secword2keypair(secword, { coin, pass, path, tool, hasher }) if (kp) { let address if (coin === 'ETH') { - address = this.pubkey2address(this.decompressPubkey(kp.pubkey), { coin: 'ETH' }) + address = this.pubkey2address(this.decompressPubkey(kp.pubkey), { coin: 'ETH', world }) } else { - address = this.pubkey2address(kp.pubkey, { coin }) + address = this.pubkey2address(kp.pubkey, { coin, world }) } return address } @@ -574,17 +574,17 @@ class TICrypto { * @return {*} * @memberof TICrypto */ - static seckey2address(seckey, { coin } = {}) { + static seckey2address(seckey, { coin, world } = {}) { coin = my.COIN_LIST.indexOf(coin?.toUpperCase()) >= 0 ? coin.toUpperCase() : my.COIN if (this.isSeckey(seckey)) { /** @type {*} */ let pubkey if (coin === 'ETH') { pubkey = this.seckey2pubkey(seckey, { compress: false }) - return this.pubkey2address(pubkey, { coin }) + return this.pubkey2address(pubkey, { coin, world }) } else { pubkey = this.seckey2pubkey(seckey, { compress: true }) - return this.pubkey2address(pubkey, { coin }) + return this.pubkey2address(pubkey, { coin, world }) } } return null @@ -765,10 +765,10 @@ class TICrypto { * @return {*} * @memberof TICrypto */ - static pubkey2address(pubkey, { coin } = {}) { + static pubkey2address(pubkey, { coin, world } = {}) { // pubkey 应当是string类型 coin = my.COIN_LIST.indexOf(coin?.toUpperCase()) >= 0 ? coin.toUpperCase() : my.COIN - return this.position2address(this.pubkey2position(pubkey, { coin }), { coin }) + return this.position2address(this.pubkey2position(pubkey, { coin }), { coin, world }) } /**