Relays
- class cometa.pool_params.relays.Relays(ptr)[source]
Bases:
objectRepresents a collection of relays for a Cardano stake pool.
This class provides a list-like interface for managing pool relays, supporting iteration, indexing, and standard list operations.
- classmethod new()[source]
Creates a new empty Relays collection.
- Returns:
A new empty Relays instance.
- Raises:
CardanoError – If creation fails.
- Return type:
- classmethod from_cbor(reader)[source]
Deserializes a Relays collection from CBOR data.
- Parameters:
reader (CborReader) – A CborReader positioned at the relays data.
- Returns:
A new Relays deserialized from the CBOR data.
- Raises:
CardanoError – If deserialization fails.
- Return type:
- to_cbor(writer)[source]
Serializes the relays collection to CBOR format.
- Parameters:
writer (CborWriter) – A CborWriter to write the serialized data to.
- Raises:
CardanoError – If serialization fails.
- Return type:
None
- add(relay)[source]
Adds a relay to the collection.
- Parameters:
relay (Relay | SingleHostAddrRelay | SingleHostNameRelay | MultiHostNameRelay) – The relay to add. Can be a Relay or any specific relay type.
- Raises:
CardanoError – If adding fails.
- Return type:
None
- append(relay)[source]
Appends a relay to the collection (alias for add).
- Parameters:
relay (Relay | SingleHostAddrRelay | SingleHostNameRelay | MultiHostNameRelay) – The relay to append. Can be a Relay or any specific relay type.
- Raises:
CardanoError – If appending fails.
- Return type:
None
- extend(relays)[source]
Extends the collection with relays from another collection or list.
- Parameters:
relays (Relays | List[Relay | SingleHostAddrRelay | SingleHostNameRelay | MultiHostNameRelay]) – Another Relays collection or a list of relay-like objects.
- Raises:
CardanoError – If extending fails.
- Return type:
None
- to_cip116_json(writer)[source]
Serializes this relays collection to CIP-116 compliant JSON.
- Parameters:
writer (JsonWriter) – The JsonWriter to write the JSON to.
- Raises:
CardanoError – If serialization fails.
- Return type:
None