Certificate
- class pycardano.certificate.StakeCredential(credential: Union[VerificationKeyHash, ScriptHash])
Bases:
ArrayCBORSerializable
Represents a stake credential in the Cardano blockchain.
A stake credential can either be a verification key hash or a script hash, used to identify stake rights and permissions.
- credential: Union[VerificationKeyHash, ScriptHash]
The actual credential, either a verification key hash or script hash
- classmethod from_primitive(values: Union[list, tuple]) StakeCredential
Restore a primitive value to its original class type.
- Parameters:
cls (ArrayBase) – The original class type.
values (List[Primitive]) – A list whose elements are CBOR primitives.
- Returns:
Restored object.
- Return type:
ArrayBase
- Raises:
DeserializeException – When the object could not be restored from primitives.
- class pycardano.certificate.StakeRegistration(stake_credential: StakeCredential)
Bases:
CodedSerializable
Certificate for registering a stake credential.
- stake_credential: StakeCredential
The stake credential being registered
- class pycardano.certificate.StakeDeregistration(stake_credential: StakeCredential)
Bases:
CodedSerializable
Certificate for deregistering a stake credential.
- stake_credential: StakeCredential
The stake credential being deregistered
- class pycardano.certificate.StakeDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash)
Bases:
CodedSerializable
Certificate for delegating stake to a stake pool.
- stake_credential: StakeCredential
The stake credential being delegated
- pool_keyhash: PoolKeyHash
The hash of the pool’s key to delegate to
- class pycardano.certificate.PoolRegistration(pool_params: PoolParams)
Bases:
CodedSerializable
Certificate for registering a stake pool.
- pool_params: PoolParams
The parameters defining the stake pool’s configuration
- to_primitive()
Convert the instance and its elements to CBOR primitives recursively.
- Returns:
A CBOR primitive.
- Return type:
Primitive
- Raises:
SerializeException – When the object or its elements could not be converted to CBOR primitive types.
- classmethod from_primitive(values: Union[list, tuple]) PoolRegistration
Restore a primitive value to its original class type.
- Parameters:
cls (ArrayBase) – The original class type.
values (List[Primitive]) – A list whose elements are CBOR primitives.
- Returns:
Restored object.
- Return type:
ArrayBase
- Raises:
DeserializeException – When the object could not be restored from primitives.
- class pycardano.certificate.PoolRetirement(pool_keyhash: PoolKeyHash, epoch: int)
Bases:
CodedSerializable
Certificate for retiring a stake pool.
- pool_keyhash: PoolKeyHash
The hash of the pool’s key that is being retired
- epoch: int
The epoch number when the pool will retire
- class pycardano.certificate.StakeRegistrationConway(stake_credential: StakeCredential, coin: int)
Bases:
CodedSerializable
Certificate for registering a stake credential in the Conway era.
- stake_credential: StakeCredential
The stake credential being registered
- coin: int
The amount of coins associated with this registration
- class pycardano.certificate.StakeDeregistrationConway(stake_credential: StakeCredential, coin: int)
Bases:
CodedSerializable
Certificate for deregistering a stake credential in the Conway era.
- stake_credential: StakeCredential
The stake credential being deregistered
- coin: int
The amount of coins associated with this deregistration
- class pycardano.certificate.VoteDelegation(stake_credential: StakeCredential, drep: DRep)
Bases:
CodedSerializable
Certificate for delegating voting power to a DRep.
- stake_credential: StakeCredential
The stake credential delegating its voting power
- class pycardano.certificate.StakeAndVoteDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash, drep: DRep)
Bases:
CodedSerializable
Certificate for delegating both stake and voting power.
- stake_credential: StakeCredential
The stake credential being delegated
- pool_keyhash: PoolKeyHash
The hash of the pool’s key receiving the stake delegation
- class pycardano.certificate.StakeRegistrationAndDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash, coin: int)
Bases:
CodedSerializable
Certificate for registering stake and delegating to a pool.
- stake_credential: StakeCredential
The stake credential being registered and delegated
- pool_keyhash: PoolKeyHash
The hash of the pool’s key receiving the delegation
- coin: int
The amount of coins associated with this registration
- class pycardano.certificate.StakeRegistrationAndVoteDelegation(stake_credential: StakeCredential, drep: DRep, coin: int)
Bases:
CodedSerializable
Certificate for registering stake and delegating voting power.
- stake_credential: StakeCredential
The stake credential being registered
- coin: int
The amount of coins associated with this registration
- class pycardano.certificate.StakeRegistrationAndDelegationAndVoteDelegation(stake_credential: StakeCredential, pool_keyhash: PoolKeyHash, drep: DRep, coin: int)
Bases:
CodedSerializable
Certificate for registering stake and delegating both stake and voting power.
- stake_credential: StakeCredential
The stake credential being registered and delegated
- pool_keyhash: PoolKeyHash
The hash of the pool’s key receiving the stake delegation
- coin: int
The amount of coins associated with this registration
- class pycardano.certificate.DRep(kind: DRepKind, credential: Optional[Union[VerificationKeyHash, ScriptHash]] = None)
Bases:
ArrayCBORSerializable
Represents a Delegate Representative (DRep) in the Cardano governance system.
DReps are entities that can represent stake holders in governance decisions.
- kind: DRepKind
The type of DRep (verification key, script hash, always abstain, or always no confidence)
- credential: Optional[Union[VerificationKeyHash, ScriptHash]] = None
The credential associated with this DRep, if applicable
- classmethod from_primitive(values: Union[list, tuple]) DRep
Restore a primitive value to its original class type.
- Parameters:
cls (ArrayBase) – The original class type.
values (List[Primitive]) – A list whose elements are CBOR primitives.
- Returns:
Restored object.
- Return type:
ArrayBase
- Raises:
DeserializeException – When the object could not be restored from primitives.
- to_primitive()
Convert the instance and its elements to CBOR primitives recursively.
- Returns:
A CBOR primitive.
- Return type:
Primitive
- Raises:
SerializeException – When the object or its elements could not be converted to CBOR primitive types.
- class pycardano.certificate.DRepKind(value)
Bases:
Enum
Enumerates the different types of Delegate Representatives (DReps).
Defines the possible kinds of DReps in the Cardano governance system: - VERIFICATION_KEY_HASH: A DRep identified by a verification key hash - SCRIPT_HASH: A DRep identified by a script hash - ALWAYS_ABSTAIN: A special DRep that always abstains from voting - ALWAYS_NO_CONFIDENCE: A special DRep that always votes no confidence
- VERIFICATION_KEY_HASH = 0
- SCRIPT_HASH = 1
- ALWAYS_ABSTAIN = 2
- ALWAYS_NO_CONFIDENCE = 3
- class pycardano.certificate.AuthCommitteeHotCertificate(committee_cold_credential: StakeCredential, committee_hot_credential: StakeCredential)
Bases:
CodedSerializable
Certificate for authorizing a committee hot key.
- committee_cold_credential: StakeCredential
The cold credential of the committee member
- committee_hot_credential: StakeCredential
The hot credential being authorized
- class pycardano.certificate.ResignCommitteeColdCertificate(committee_cold_credential: StakeCredential, anchor: Optional[Anchor])
Bases:
CodedSerializable
Certificate for resigning from the constitutional committee.
- committee_cold_credential: StakeCredential
The cold credential of the resigning committee member
- class pycardano.certificate.Anchor(url: str, data_hash: AnchorDataHash)
Bases:
ArrayCBORSerializable
Represents an anchor in the Cardano blockchain that contains a URL and associated data hash.
Anchors are used to provide additional metadata or reference external resources in certificates.
- url: str
The URL pointing to the anchor’s resource location
- data_hash: AnchorDataHash
The hash of the data associated with this anchor
- class pycardano.certificate.DRepCredential(credential: Union[VerificationKeyHash, ScriptHash])
Bases:
StakeCredential
Represents a Delegate Representative (DRep) credential.
This credential type is specifically used for DReps in the governance system, inheriting from StakeCredential.
- credential: Union[VerificationKeyHash, ScriptHash]
The actual credential, either a verification key hash or script hash
- class pycardano.certificate.RegDRepCert(drep_credential: DRepCredential, coin: int, anchor: Optional[Anchor] = None)
Bases:
CodedSerializable
Certificate for registering as a delegate representative (DRep).
- drep_credential: DRepCredential
The credential of the DRep being registered
- coin: int
The amount of coins associated with this registration
- class pycardano.certificate.UnregDRepCertificate(drep_credential: DRepCredential, coin: int)
Bases:
CodedSerializable
Certificate for unregistering as a delegate representative (DRep).
- drep_credential: DRepCredential
The credential of the DRep being unregistered
- coin: int
The amount of coins associated with this unregistration
- class pycardano.certificate.UpdateDRepCertificate(drep_credential: DRepCredential, anchor: Optional[Anchor])
Bases:
CodedSerializable
Certificate for updating delegate representative (DRep) metadata.
- drep_credential: DRepCredential
The credential of the DRep being updated