PointerAddress
- class cometa.address.pointer_address.PointerAddress(ptr)[source]
Bases:
objectRepresents a Cardano pointer address.
Pointer addresses indirectly specify the stake key that should control staking for the address. Instead of embedding a stake key directly, they reference a stake key by pointing to a stake key registration certificate location on the blockchain.
- classmethod from_credentials(network_id, payment, pointer)[source]
Creates a pointer address from a payment credential and stake pointer.
- Parameters:
network_id (NetworkId) – The network (mainnet or testnet).
payment (Credential) – The payment credential controlling spending.
pointer (StakePointer) – The stake pointer referencing a stake key registration.
- Returns:
A new PointerAddress instance.
- Raises:
CardanoError – If address creation fails.
- Return type:
Example
>>> payment = Credential.from_key_hash("00" * 28) >>> pointer = StakePointer(slot=5756214, tx_index=1, cert_index=0) >>> addr = PointerAddress.from_credentials(NetworkId.MAINNET, payment, pointer)
- classmethod from_address(address)[source]
Creates a PointerAddress from a generic Address.
- Parameters:
address (Address) – A generic Address that must be a pointer address.
- Returns:
A new PointerAddress instance.
- Raises:
CardanoError – If the address is not a pointer address.
- Return type:
- classmethod from_bech32(bech32_string)[source]
Creates a PointerAddress from a Bech32-encoded string.
- Parameters:
bech32_string (str) – The Bech32-encoded address string.
- Returns:
A new PointerAddress instance.
- Raises:
CardanoError – If parsing fails.
- Return type:
- classmethod from_bytes(data)[source]
Creates a PointerAddress from raw bytes.
- Parameters:
data (bytes | bytearray) – The serialized address bytes.
- Returns:
A new PointerAddress instance.
- Raises:
CardanoError – If parsing fails.
- Return type:
- property payment_credential: Credential
Returns the payment credential.
- property stake_pointer: StakePointer
Returns the stake pointer.