Skip to content

Commit

Permalink
Update: All HDWallet example components.
Browse files Browse the repository at this point in the history
  • Loading branch information
meherett committed Dec 25, 2021
1 parent 0644caf commit e0ec7e7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions examples/from_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/from_private_key.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env python3

from hdwallet import HDWallet
from hdwallet.symbols import QTUM
from hdwallet.symbols import QTUM as SYMBOL

import json

# Qtum private key
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)

Expand Down
4 changes: 2 additions & 2 deletions examples/from_public_key.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env python3

from hdwallet import HDWallet
from hdwallet.symbols import ETH
from hdwallet.symbols import ETH as SYMBOL

import json

# Ethereum public key
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)

Expand Down
4 changes: 2 additions & 2 deletions examples/from_seed.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions examples/from_wif.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env python3

from hdwallet import HDWallet
from hdwallet.symbols import BTCTEST
from hdwallet.symbols import BTCTEST as SYMBOL

import json

# Bitcoin wallet important format
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)

Expand Down
4 changes: 2 additions & 2 deletions examples/from_xprivate_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions examples/from_xpublic_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)

Expand Down

0 comments on commit e0ec7e7

Please sign in to comment.