Skip to content

Commit 051c00d

Browse files
committed
Revert "updated hdwallet version/code - Merge branch 'skrtdev-master'"
This reverts commit 9469c5f.
1 parent 9469c5f commit 051c00d

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

bitcoinutils/hdwallet.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
from typing import Optional
1313

1414
from hdwallet import HDWallet as ext_HDWallet # type: ignore
15-
from hdwallet.cryptocurrencies import Bitcoin
16-
from hdwallet.derivations import CustomDerivation
17-
from hdwallet.mnemonics import BIP39Mnemonic
15+
from hdwallet.symbols import BTC, BTCTEST # type: ignore
1816

1917
from bitcoinutils.setup import is_mainnet
2018
from bitcoinutils.keys import PrivateKey
@@ -42,14 +40,20 @@ def __init__(
4240
):
4341
"""Instantiate a hdwallet object using the corresponding library with BTC"""
4442

45-
self.hdw = ext_HDWallet(cryptocurrency=Bitcoin, network='mainnet' if is_mainnet() else 'testnet')
43+
symbol = None
44+
if is_mainnet():
45+
symbol = BTC
46+
else:
47+
symbol = BTCTEST
48+
49+
self.hdw = ext_HDWallet(symbol)
4650

4751
if mnemonic:
48-
self.hdw.from_mnemonic(mnemonic=BIP39Mnemonic(mnemonic=mnemonic))
52+
self.hdw.from_mnemonic(mnemonic=mnemonic)
4953

5054
if xprivate_key and path:
5155
self.hdw.from_xprivate_key(xprivate_key=xprivate_key)
52-
self.hdw.from_derivation(CustomDerivation(path))
56+
self.hdw.from_path(path=path)
5357

5458
@classmethod
5559
def from_mnemonic(cls, mnemonic: str):
@@ -68,7 +72,7 @@ def from_path(self, path: str):
6872
"""Set/update the path"""
6973

7074
self.hdw.clean_derivation() # type: ignore
71-
self.hdw.from_derivation(CustomDerivation(path))
75+
self.hdw.from_path(path=path)
7276

7377
def get_private_key(self):
7478
"""Return a PrivateKey object used throughout bitcoinutils library"""

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
base58check>=1.0.2,<2.0
2-
ecdsa==0.19.0
2+
ecdsa==0.18.0
33
sympy>=1.2,<2.0
44
python-bitcoinrpc>=1.0,<2.0
5-
hdwallet~=3.0
5+
hdwallet==2.2.1

0 commit comments

Comments
 (0)