PoolParams

class cometa.pool_params.pool_params.PoolParams(ptr)[source]

Bases: object

Represents stake pool registration/update certificate parameters.

Pool parameters include: - operator_key_hash: The pool operator’s Ed25519 key hash - vrf_vk_hash: The VRF verification key hash (32 bytes) - pledge: The amount of ADA pledged by the operator (in lovelaces) - cost: The operational cost per epoch (in lovelaces) - margin: The pool operator’s margin (fraction of rewards) - reward_account: The account where rewards are deposited - owners: The set of pool owner key hashes - relays: The pool’s network relays - metadata: Optional URL and hash of pool metadata

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

PoolParams

__exit__(exc_type, exc_val, exc_tb)[source]
Return type:

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new(operator_key_hash, vrf_vk_hash, pledge, cost, margin, reward_account, owners, relays, metadata=None)[source]

Creates new pool parameters.

Parameters:
  • operator_key_hash (Blake2bHash) – The pool operator’s key hash (28 bytes).

  • vrf_vk_hash (Blake2bHash) – The VRF verification key hash (32 bytes).

  • pledge (int) – The pledge amount in lovelaces.

  • cost (int) – The operational cost per epoch in lovelaces.

  • margin (UnitInterval) – The pool margin as a unit interval (0 to 1).

  • reward_account (RewardAddress) – The reward account address.

  • owners (PoolOwners) – The set of pool owner key hashes.

  • relays (Relays) – The pool’s network relays.

  • metadata (PoolMetadata | None) – Optional pool metadata (URL and hash).

Returns:

A new PoolParams instance.

Raises:

CardanoError – If creation fails.

Return type:

PoolParams

Example

>>> params = PoolParams.new(
...     operator_key_hash=operator_hash,
...     vrf_vk_hash=vrf_hash,
...     pledge=1000000000,  # 1000 ADA
...     cost=340000000,     # 340 ADA
...     margin=UnitInterval.new(1, 100),  # 1%
...     reward_account=reward_addr,
...     owners=owners,
...     relays=relays,
...     metadata=metadata
... )
classmethod from_cbor(reader)[source]

Deserializes PoolParams from CBOR data.

Parameters:

reader (CborReader) – A CborReader positioned at the pool params data.

Returns:

A new PoolParams deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

PoolParams

to_cbor(writer)[source]

Serializes the pool params to CBOR format.

Parameters:

writer (CborWriter) – A CborWriter to write the serialized data to.

Raises:

CardanoError – If serialization fails.

Return type:

None

property operator_key_hash: Blake2bHash

Returns the pool operator’s key hash.

property vrf_vk_hash: Blake2bHash

Returns the VRF verification key hash.

property pledge: int

Returns the pledge amount in lovelaces.

property cost: int

Returns the operational cost per epoch in lovelaces.

property margin: UnitInterval

Returns the pool margin.

property reward_account: RewardAddress

Returns the reward account address.

property owners: PoolOwners

Returns the pool owners.

property relays: Relays

Returns the pool relays.

property metadata: PoolMetadata | None

Returns the pool metadata, or None if not set.

to_cip116_json(writer)[source]

Serializes this pool params to CIP-116 compliant JSON.

Parameters:

writer (JsonWriter) – The JsonWriter to write the JSON to.

Raises:

CardanoError – If serialization fails.

Return type:

None