hd_wallet_cardano_shelley_factory
Module for creating Cardano Shelley wallet factories.
- class HdWalletCardanoShelleyFactory(coin_type: Cip1852Coins)
Bases:
objectHD wallet Cardano Shelley factory class. It allows a HdWalletCardanoShelley to be created in different ways.
- m_coin: Cip1852Coins
- CreateRandom(wallet_name: str, words_num: Optional[Bip39WordsNum] = None, lang: Bip39Languages = Bip39Languages.ENGLISH) HdWalletBase
Create wallet randomly.
- Parameters:
wallet_name (str) – Wallet name
words_num (HdWalletCardanoShelleyWordsNum, optional) – Words number (default: 15 for Icaurs, 24 for Ledger)
lang (HdWalletCardanoShelleyLanguages, optional) – Language (default: English)
- Returns:
HdWalletBase object
- Return type:
HdWalletBase object
- Raises:
TypeError – If words number is not a HdWalletBipWordsNum enum or language is not a HdWalletBipLanguages enum
- CreateFromMnemonic(wallet_name: str, mnemonic: str, passphrase: str = '') HdWalletBase
Create wallet from mnemonic.
- Parameters:
wallet_name (str) – Wallet name
mnemonic (str) – Mnemonic
passphrase (str, optional) – Passphrase for protecting mnemonic, empty if not specified
- Returns:
HdWalletBase object
- Return type:
HdWalletBase object
- Raises:
ValueError – If the mnemonic is not valid
- CreateFromSeed(wallet_name: str, seed_bytes: bytes) HdWalletBase
Create wallet from seed.
- Parameters:
wallet_name (str) – Wallet name
seed_bytes (bytes) – Seed bytes
- Returns:
HdWalletBase object
- Return type:
HdWalletBase object
- Raises:
ValueError – If the seed is not valid
- CreateFromPrivateKey(wallet_name: str, priv_key_bytes: bytes) HdWalletBase
Create wallet from private key. The key will be considered a master key.
- Parameters:
wallet_name (str) – Wallet name
priv_key_bytes (bytes) – Private key bytes
- Returns:
HdWalletBase object
- Return type:
HdWalletBase object
- Raises:
ValueError – If the private key is not valid
- CreateFromPublicKey(wallet_name: str, pub_key_bytes: bytes) HdWalletBase
Create wallet from public key. The key will be considered an account key in order to derive child keys.
- Parameters:
wallet_name (str) – Wallet name
pub_key_bytes (bytes) – Public key bytes
- Returns:
HdWalletBase object
- Return type:
HdWalletBase object
- Raises:
ValueError – If the public key is not valid