MirToPotCert

class cometa.certificates.mir_to_pot_cert.MirToPotCert(ptr)[source]

Bases: object

Represents a Move Instantaneous Reward (MIR) certificate for transferring funds between pots.

This certificate is used to transfer a specified amount of ADA from one accounting pot (reserve or treasury) to the other pot.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

MirToPotCert

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

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new(pot_type, amount)[source]

Creates a new MIR to pot certificate.

Parameters:
  • pot_type (MirCertPotType) – The accounting pot from which funds will be drawn.

  • amount (int) – The amount of ADA to be transferred.

Returns:

A new MirToPotCert instance.

Raises:

CardanoError – If creation fails.

Return type:

MirToPotCert

classmethod from_cbor(reader)[source]

Deserializes a MirToPotCert from CBOR data.

Parameters:

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

Returns:

A new MirToPotCert deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

MirToPotCert

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 pot: MirCertPotType

The accounting pot from which funds are drawn.

Returns:

The MirCertPotType indicating the source pot.

property amount: int

The amount of ADA to be transferred.

Returns:

The amount in lovelace.

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