From e2a0a9830bee4fb4a1dc03f983abd90cd5e96b75 Mon Sep 17 00:00:00 2001 From: armatusmiles Date: Wed, 7 Feb 2018 00:41:55 +0200 Subject: [PATCH] update create address for ETH --- pywallet/wallet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pywallet/wallet.py b/pywallet/wallet.py index e8c7426..b96812e 100644 --- a/pywallet/wallet.py +++ b/pywallet/wallet.py @@ -30,13 +30,14 @@ def create_address(network='btctest', xpub=None, child=None, path=0): if network == 'ethereum' or network.upper() == 'ETH': acct_pub_key = HDKey.from_b58check(xpub) + keys = HDKey.from_path( acct_pub_key, '{change}/{index}'.format(change=path, index=child)) res = { - "path": "m/" + str(acct_pub_key.index) + "/" + str(keys[-1].index), + "path": "m/" + str(acct_pub_key.index) + "/" + str(keys[1].index), "bip32_path": "m/44'/60'/0'/" + str(acct_pub_key.index) + "/" + str(keys[-1].index), - "address": keys[-1].address() + "address": keys[1].address() } if inspect.stack()[1][3] == "create_wallet":