monero
Module for Monero keys computation and derivation.
- class Monero(priv_key: Union[bytes, IPrivateKey], pub_key: Optional[Union[bytes, IPublicKey]] = None, coin_type: MoneroCoins = MoneroCoins.MONERO_MAINNET)
Bases:
object
Monero class. It allows to compute Monero keys and addresses/subaddresses.
- classmethod FromSeed(seed_bytes: bytes, coin_type: MoneroCoins = MoneroCoins.MONERO_MAINNET) Monero
Create from seed bytes.
- Parameters:
seed_bytes (bytes) – Seed bytes
coin_type (MoneroCoins, optional) – Coin type (default: main net)
- Returns:
Monero object
- Return type:
Monero object
- classmethod FromBip44PrivateKey(priv_key: Union[bytes, IPrivateKey], coin_type: MoneroCoins = MoneroCoins.MONERO_MAINNET) Monero
Create from Bip44 private key bytes.
- Parameters:
priv_key (bytes or IPrivateKey) – Private key
coin_type (MoneroCoins, optional) – Coin type (default: main net)
- Returns:
Monero object
- Return type:
Monero object
- classmethod FromPrivateSpendKey(priv_skey: Union[bytes, IPrivateKey], coin_type: MoneroCoins = MoneroCoins.MONERO_MAINNET) Monero
Create from private spend key.
- Parameters:
priv_skey (bytes or IPrivateKey) – Private spend key
coin_type (MoneroCoins, optional) – Coin type (default: main net)
- Returns:
Monero object
- Return type:
Monero object
- Raises:
MoneroKeyError – If the key constructed from the bytes is not valid
- classmethod FromWatchOnly(priv_vkey: Union[bytes, IPrivateKey], pub_skey: Union[bytes, IPublicKey], coin_type: MoneroCoins = MoneroCoins.MONERO_MAINNET) Monero
Create from private view key and public spend key (i.e. watch-only wallet).
- Parameters:
priv_vkey (bytes or IPrivateKey) – Private view key
pub_skey (bytes or IPublicKey) – Public spend key
coin_type (MoneroCoins, optional) – Coin type (default: main net)
- Returns:
Monero object
- Return type:
Monero object
- Raises:
MoneroKeyError – If the key constructed from the bytes is not valid
- m_priv_skey: Optional[MoneroPrivateKey]
- m_priv_vkey: MoneroPrivateKey
- m_pub_skey: MoneroPublicKey
- m_pub_vkey: MoneroPublicKey
- m_coin_conf: MoneroCoinConf
- m_subaddr: MoneroSubaddress
- IsWatchOnly() bool
Return if it’s a watch-only object.
- Returns:
True if watch-only, false otherwise
- Return type:
bool
- CoinConf() MoneroCoinConf
Return coin configuration.
- Returns:
MoneroCoinConf object
- Return type:
MoneroCoinConf object
- PrivateSpendKey() MoneroPrivateKey
Return the private spend key.
- Returns:
MoneroPrivateKey object
- Return type:
MoneroPrivateKey object
- Raises:
MoneroKeyError – If the class is watch-only
- PrivateViewKey() MoneroPrivateKey
Return the private view key.
- Returns:
MoneroPrivateKey object
- Return type:
MoneroPrivateKey object
- PublicSpendKey() MoneroPublicKey
Return the public spend key.
- Returns:
MoneroPublicKey object
- Return type:
MoneroPublicKey object
- PublicViewKey() MoneroPublicKey
Return the public view key.
- Returns:
MoneroPublicKey object
- Return type:
MoneroPublicKey object
- IntegratedAddress(payment_id: bytes) str
Return the integrated address with the specified payment ID.
- Parameters:
payment_id (bytes) – Payment ID
- Returns:
Integrated address string
- Return type:
str
- PrimaryAddress() str
Return the primary address.
- Returns:
Primary address string
- Return type:
str
- Subaddress(minor_idx: int, major_idx: int = 0) str
Return the specified subaddress.
- Parameters:
minor_idx (int) – Minor index (i.e. subaddress index)
major_idx (int, optional) – Major index (i.e. account index, default: 0)
- Returns:
Subaddress string
- Return type:
str
- Raises:
ValueError – If one of the indexes is not valid