MirCert

class cometa.certificates.mir_cert.MirCert(ptr)[source]

Bases: object

Represents a Move Instantaneous Reward (MIR) certificate.

This certificate facilitates an instantaneous transfer of rewards within the system. It can either move funds between accounting pots (reserve/treasury) or transfer rewards to a specified set of stake credentials.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

MirCert

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

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new_to_other_pot(to_other_pot_cert)[source]

Creates a MIR certificate for transferring funds to another accounting pot.

Parameters:

to_other_pot_cert (MirToPotCert) – A MirToPotCert specifying the pot transfer details.

Returns:

A new MirCert instance.

Raises:

CardanoError – If creation fails.

Return type:

MirCert

classmethod new_to_stake_creds(to_stake_creds_cert)[source]

Creates a MIR certificate for transferring funds to stake credentials.

Parameters:

to_stake_creds_cert (MirToStakeCredsCert) – A MirToStakeCredsCert specifying the stake credential transfers.

Returns:

A new MirCert instance.

Raises:

CardanoError – If creation fails.

Return type:

MirCert

classmethod from_cbor(reader)[source]

Deserializes a MirCert from CBOR data.

Parameters:

reader (CborReader) – A CborReader positioned at the certificate data.

Returns:

A new MirCert deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

MirCert

to_cbor(writer)[source]

Serializes the certificate to CBOR format.

Parameters:

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

Raises:

CardanoError – If serialization fails.

Return type:

None

property cert_type: MirCertType

The type of this MIR certificate.

Returns:

The MirCertType indicating whether this is a pot transfer or stake credentials transfer.

as_to_other_pot()[source]

Retrieves this certificate as a MirToPotCert.

Returns:

The underlying MirToPotCert.

Raises:

CardanoError – If this certificate is not a pot transfer type.

Return type:

MirToPotCert

as_to_stake_creds()[source]

Retrieves this certificate as a MirToStakeCredsCert.

Returns:

The underlying MirToStakeCredsCert.

Raises:

CardanoError – If this certificate is not a stake credentials transfer type.

Return type:

MirToStakeCredsCert

to_cip116_json(writer)[source]

Serializes this certificate to CIP-116 compliant JSON.

Parameters:

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

Raises:

CardanoError – If serialization fails.

Return type:

None