Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data GYTxCert v
- type GYTxCertWitness v = GYTxBuildWitness v
- pattern GYTxCertWitnessKey ∷ GYTxCertWitness v
- pattern GYTxCertWitnessScript ∷ GYBuildPlutusScript v → GYRedeemer → GYTxCertWitness v
- txCertToApi ∷ GYTxCert' v → (Certificate ApiEra, Maybe (StakeCredential, Witness WitCtxStake ApiEra))
- mkStakeAddressRegistrationCertificate ∷ GYStakeCredential → GYTxBuildWitness v → GYTxCert v
- mkStakeAddressDeregistrationCertificate ∷ GYStakeCredential → GYTxBuildWitness v → GYTxCert v
- mkStakeAddressDelegationCertificate ∷ GYStakeCredential → GYDelegatee → GYTxBuildWitness v → GYTxCert v
- mkStakeAddressCombinedRegistrationAndDelegationCertificate ∷ GYStakeCredential → GYDelegatee → GYTxBuildWitness v → GYTxCert v
- mkDRepRegistrationCertificate ∷ GYCredential 'GYKeyRoleDRep → Maybe GYAnchor → GYTxBuildWitness v → GYTxCert v
- mkDRepUpdateCertificate ∷ GYCredential 'GYKeyRoleDRep → Maybe GYAnchor → GYTxBuildWitness v → GYTxCert v
- mkDRepUnregistrationCertificate ∷ GYCredential 'GYKeyRoleDRep → Natural → GYTxBuildWitness v → GYTxCert v
- mkStakePoolRegistrationCertificate ∷ GYPoolParams → GYTxCert v
- mkStakePoolRetirementCertificate ∷ GYKeyHash 'GYKeyRoleStakePool → GYEpochNo → GYTxCert v
- mkCommitteeHotKeyAuthCertificate ∷ GYCredential 'GYKeyRoleColdCommittee → GYCredential 'GYKeyRoleHotCommittee → GYTxCert v
- mkCommitteeColdKeyResignationCertificate ∷ GYCredential 'GYKeyRoleColdCommittee → Maybe GYAnchor → GYTxCert v
Documentation
A transaction certificate.
The parameter v
indicates the minimum version of scripts allowed to witness certificates
in the transaction.
Note that witness is not required for registering a stake address and for moving instantaneous rewards. Thus, we provide helper utilities to interact with GYTxCert
sanely and thus keep it's representation opaque.
type GYTxCertWitness v = GYTxBuildWitness v #
pattern GYTxCertWitnessKey ∷ GYTxCertWitness v #
pattern GYTxCertWitnessScript ∷ GYBuildPlutusScript v → GYRedeemer → GYTxCertWitness v #
txCertToApi ∷ GYTxCert' v → (Certificate ApiEra, Maybe (StakeCredential, Witness WitCtxStake ApiEra)) #
mkStakeAddressRegistrationCertificate ∷ GYStakeCredential → GYTxBuildWitness v → GYTxCert v #
Post conway, newer stake address registration certificate also require a witness.
mkStakeAddressDeregistrationCertificate ∷ GYStakeCredential → GYTxBuildWitness v → GYTxCert v #
Note that deregistration certificate requires following preconditions:
- The stake address must be registered.
- The corresponding rewards balance is zero.
mkStakeAddressDelegationCertificate ∷ GYStakeCredential → GYDelegatee → GYTxBuildWitness v → GYTxCert v #
mkStakeAddressCombinedRegistrationAndDelegationCertificate ∷ GYStakeCredential → GYDelegatee → GYTxBuildWitness v → GYTxCert v #
Rules for combined registration and delegation certificate are same as for individual registration and delegation certificates.
mkDRepRegistrationCertificate ∷ GYCredential 'GYKeyRoleDRep → Maybe GYAnchor → GYTxBuildWitness v → GYTxCert v #
Note that delegation certificate requires following preconditions:
- DRep must not already be registered.
- Deposit amount should be that given by corresponding protocol parameter.
- Signature from the corresponding DRep key.
mkDRepUpdateCertificate ∷ GYCredential 'GYKeyRoleDRep → Maybe GYAnchor → GYTxBuildWitness v → GYTxCert v #
Note that update certificate requires following preconditions:
- DRep must already be registered.
- Signature from the corresponding DRep key.
mkDRepUnregistrationCertificate ∷ GYCredential 'GYKeyRoleDRep → Natural → GYTxBuildWitness v → GYTxCert v #
Note that unregistration certificate requires following preconditions:
- DRep must already be registered.
- Refund amount should be same as the deposit made by DRep while registration.
- Signature from the corresponding DRep key.
mkStakePoolRegistrationCertificate ∷ GYPoolParams → GYTxCert v #
Note that stake pool registration certificate requires following preconditions:
poolCost
must be more than minimum pool cost specified in protocol parameters.- Signature from the key corresponding to
poolId
. - If registering for the first time, then deposit is also deducted to that given by corresponding protocol parameter (ppPoolDepositL).
- Signature from pool owners.
mkStakePoolRetirementCertificate ∷ GYKeyHash 'GYKeyRoleStakePool → GYEpochNo → GYTxCert v #
Note that stake pool retirement certificate requires following preconditions:
- Signature from the key corresponding to
poolId
. - Epoch must be greater than the current epoch and less than or equal to ppEMax after the current epoch.
- The pool must be registered.
Note that deposit made earlier is returned at epoch transition.
mkCommitteeHotKeyAuthCertificate ∷ GYCredential 'GYKeyRoleColdCommittee → GYCredential 'GYKeyRoleHotCommittee → GYTxCert v #
Note that committee hot key auth certificate requires following preconditions:
- Cold key must not have resigned from the committee.
- Should be part of current committee or future committee as dictated by a governance action.
- Signature from the corresponding cold committee key.
mkCommitteeColdKeyResignationCertificate #
∷ GYCredential 'GYKeyRoleColdCommittee | |
→ Maybe GYAnchor | Potential explanation for resignation. |
→ GYTxCert v |
Note that committee cold key resignation certificate requires following preconditions:
- Cold key must not have resigned from the committee.
- Should be part of current committee or future committee as dictated by a governance action.
- Signature from the corresponding cold committee key.