EnterpriseAddress
- class cometa.address.enterprise_address.EnterpriseAddress(ptr)[source]
Bases:
objectRepresents a Cardano enterprise address.
Enterprise addresses contain only a payment credential and no stake credential. Using these addresses means opting out of staking participation.
Note: Using addresses with no stake rights decreases the total stake in the network, which could benefit potential adversaries of the proof-of-stake protocol.
- classmethod from_credentials(network_id, payment)[source]
Creates an enterprise address from a payment credential.
- Parameters:
network_id (NetworkId) – The network (mainnet or testnet).
payment (Credential) – The payment credential controlling spending.
- Returns:
A new EnterpriseAddress instance.
- Raises:
CardanoError – If address creation fails.
- Return type:
Example
>>> payment = Credential.from_key_hash("00" * 28) >>> addr = EnterpriseAddress.from_credentials(NetworkId.MAINNET, payment)
- classmethod from_address(address)[source]
Creates an EnterpriseAddress from a generic Address.
- Parameters:
address (Address) – A generic Address that must be an enterprise address.
- Returns:
A new EnterpriseAddress instance.
- Raises:
CardanoError – If the address is not an enterprise address.
- Return type:
- classmethod from_bech32(bech32_string)[source]
Creates an EnterpriseAddress from a Bech32-encoded string.
- Parameters:
bech32_string (str) – The Bech32-encoded address string.
- Returns:
A new EnterpriseAddress instance.
- Raises:
CardanoError – If parsing fails.
- Return type:
- classmethod from_bytes(data)[source]
Creates an EnterpriseAddress from raw bytes.
- Parameters:
data (bytes | bytearray) – The serialized address bytes.
- Returns:
A new EnterpriseAddress instance.
- Raises:
CardanoError – If parsing fails.
- Return type:
- property payment_credential: Credential
Returns the payment credential.