From e0ec7e75cf0ebf8440038562bbdbcc1c676d02f1 Mon Sep 17 00:00:00 2001 From: meherett Date: Sat, 25 Dec 2021 07:54:34 +0300 Subject: [PATCH] Update: All HDWallet example components. --- examples/from_entropy.py | 4 ++-- examples/from_private_key.py | 4 ++-- examples/from_public_key.py | 4 ++-- examples/from_seed.py | 4 ++-- examples/from_wif.py | 4 ++-- examples/from_xprivate_key.py | 4 ++-- examples/from_xpublic_key.py | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/from_entropy.py b/examples/from_entropy.py index 3b83069..66d7817 100644 --- a/examples/from_entropy.py +++ b/examples/from_entropy.py @@ -2,7 +2,7 @@ from hdwallet import HDWallet from hdwallet.utils import generate_entropy -from hdwallet.symbols import BTC +from hdwallet.symbols import TRX as SYMBOL from typing import Optional import json @@ -17,7 +17,7 @@ PASSPHRASE: Optional[str] = None # "meherett" # Initialize Bitcoin mainnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=BTC) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Bitcoin HDWallet from entropy hdwallet.from_entropy( entropy=ENTROPY, language=LANGUAGE, passphrase=PASSPHRASE diff --git a/examples/from_private_key.py b/examples/from_private_key.py index 45c2364..421b7eb 100644 --- a/examples/from_private_key.py +++ b/examples/from_private_key.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from hdwallet import HDWallet -from hdwallet.symbols import QTUM +from hdwallet.symbols import QTUM as SYMBOL import json @@ -9,7 +9,7 @@ PRIVATE_KEY: str = "f86d5afe2a457c29357485ebf853a1e5ff5f6fcf1ba4d7d1412665e01449902e" # Initialize Qtum mainnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=QTUM) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Qtum HDWallet from private key hdwallet.from_private_key(private_key=PRIVATE_KEY) diff --git a/examples/from_public_key.py b/examples/from_public_key.py index 34cb53a..cf76dc6 100644 --- a/examples/from_public_key.py +++ b/examples/from_public_key.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from hdwallet import HDWallet -from hdwallet.symbols import ETH +from hdwallet.symbols import ETH as SYMBOL import json @@ -9,7 +9,7 @@ PUBLIC_KEY = "034f6922d19e8134de23eb98396921c02cdcf67e8c0ff23dfd955839cd557afd10" # Initialize Ethereum mainnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=ETH) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Ethereum HDWallet from public key hdwallet.from_public_key(public_key=PUBLIC_KEY) diff --git a/examples/from_seed.py b/examples/from_seed.py index 18766b1..9104176 100644 --- a/examples/from_seed.py +++ b/examples/from_seed.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from hdwallet import HDWallet -from hdwallet.symbols import DOGE +from hdwallet.symbols import DOGE as SYMBOL import json @@ -10,7 +10,7 @@ "8723bc545a4bd51f5cd29a3e8bd1433bd1d26e6bf866ff53d1493f" # Initialize Dogecoin mainnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=DOGE) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Dogecoin HDWallet from seed hdwallet.from_seed(seed=SEED) diff --git a/examples/from_wif.py b/examples/from_wif.py index 4695317..517ffc4 100644 --- a/examples/from_wif.py +++ b/examples/from_wif.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from hdwallet import HDWallet -from hdwallet.symbols import BTCTEST +from hdwallet.symbols import BTCTEST as SYMBOL import json @@ -9,7 +9,7 @@ WALLET_IMPORTANT_FORMAT: str = "cVpnZ6XRfL5VVggwZDyndAU5KGVdT2TP1j1HB3td6ZKWCbh5wYvf" # Initialize Bitcoin testnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=BTCTEST) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Bitcoin HDWallet from wallet important format hdwallet.from_wif(wif=WALLET_IMPORTANT_FORMAT) diff --git a/examples/from_xprivate_key.py b/examples/from_xprivate_key.py index 2b0316c..ff4d245 100644 --- a/examples/from_xprivate_key.py +++ b/examples/from_xprivate_key.py @@ -2,7 +2,7 @@ from hdwallet import HDWallet as HDWallet from hdwallet.utils import is_root_xprivate_key -from hdwallet.symbols import BTC +from hdwallet.symbols import BTC as SYMBOL import json @@ -20,7 +20,7 @@ assert is_root_xprivate_key(xprivate_key=XPRIVATE_KEY, symbol=BTC), "Invalid Root XPrivate Key." # Initialize Bitcoin mainnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=BTC) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Bitcoin HDWallet from xprivate key hdwallet.from_xprivate_key(xprivate_key=XPRIVATE_KEY, strict=STRICT) diff --git a/examples/from_xpublic_key.py b/examples/from_xpublic_key.py index 1650b28..04e9079 100644 --- a/examples/from_xpublic_key.py +++ b/examples/from_xpublic_key.py @@ -2,7 +2,7 @@ from hdwallet import HDWallet as HDWallet from hdwallet.utils import is_root_xpublic_key -from hdwallet.symbols import BTC +from hdwallet.symbols import BTC as SYMBOL import json @@ -17,10 +17,10 @@ if STRICT: # Check root xpublic key - assert is_root_xpublic_key(xpublic_key=XPUBLIC_KEY, symbol=BTC), "Invalid Root XPublic Key." + assert is_root_xpublic_key(xpublic_key=XPUBLIC_KEY, symbol=SYMBOL), "Invalid Root XPublic Key." # Initialize Bitcoin mainnet HDWallet -hdwallet: HDWallet = HDWallet(symbol=BTC) +hdwallet: HDWallet = HDWallet(symbol=SYMBOL) # Get Bitcoin HDWallet from xpublic key hdwallet.from_xpublic_key(xpublic_key=XPUBLIC_KEY, strict=STRICT)