ebellocchia / py_crypto_hd_wallet

HD wallet for cryptocurrencies based on my bip_utils library
MIT License
52 stars 34 forks source link

Trying Examples Error #9

Closed dendisuhubdy closed 3 years ago

dendisuhubdy commented 3 years ago
>>> from py_crypto_hd_wallet import HdWalletFactory, HdWalletCoins, HdWalletSpecs
>>> 
>>> # Create a BIP-0044 (default value) Bitcoin wallet factory
>>> hd_wallet_fact = HdWalletFactory(HdWalletCoins.BITCOIN)
>>> ex_key = "xpub661MyMwAqRbcG3PEsG7NDvmtyGb6oMcHY2ExjZJZo7y8LUgEoVTgp9PFZz4iNfaDLTfairQf21r3hP5CGYzboge4EcRNNrdEggpBo2HcJVg"
>>> hd_wallet = hd_wallet_fact.CreateFromExtendedKey("my_wallet_name", ex_key)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/chia/.local/lib/python3.8/site-packages/py_crypto_hd_wallet/hd_wallet_factory.py", line 160, in CreateFromExtendedKey
    bip_obj = self.__GetBipClass().FromExtendedKey(exkey_str, self.m_coin_idx)
  File "/home/chia/Documents/bitwyre/hdwallets/bip_utils/bip_utils/bip44/bip44_base.py", line 259, in FromExtendedKey
    return cls(bip32_cls.FromExtendedKey(key_str,
  File "/home/chia/Documents/bitwyre/hdwallets/bip_utils/bip_utils/bip44/bip44_base.py", line 318, in __init__
    raise Bip44DepthError(
bip_utils.bip44.bip44_base_ex.Bip44DepthError: Depth of the public-only Bip32 object (0) is below account level or beyond address index level
ebellocchia commented 3 years ago

Hi, thanks for the finding. Yes, it's just the public key that is not valid, I'll fix it.

dendisuhubdy commented 3 years ago

thank you @ebellocchia