Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose more functionality from cardano-api #130

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,27 @@ module Cardano.Api.Certificate (

-- * Registering stake address and delegating
StakeAddressRequirements(..),
StakeDelegationRequirements(..),
makeStakeAddressDelegationCertificate,
makeStakeAddressRegistrationCertificate,
makeStakeAddressUnregistrationCertificate,
makeStakeAddressPoolDelegationCertificate,
PoolId,

-- * Registering stake pools
StakePoolRegistrationRequirements(..),
StakePoolRetirementRequirements(..),
makeStakePoolRegistrationCertificate,
makeStakePoolRetirementCertificate,
StakePoolParameters(..),
StakePoolRelay(..),
StakePoolMetadataReference(..),

-- * Conway specific certificates
CommitteeColdkeyResignationRequirements(..),
CommitteeHotKeyAuthorizationRequirements(..),
DRepRegistrationRequirements(..),
DRepUnregistrationRequirements(..),
makeCommitteeColdkeyResignationCertificate,
makeCommitteeHotKeyAuthorizationCertificate,
makeDrepRegistrationCertificate,
Expand All @@ -42,6 +50,8 @@ module Cardano.Api.Certificate (
DRepMetadataReference(..),

-- * Special certificates
GenesisKeyDelegationRequirements(..),
MirCertificateRequirements(..),
makeMIRCertificate,
makeGenesisKeyDelegationCertificate,
Ledger.MIRTarget (..),
Expand Down Expand Up @@ -532,7 +542,6 @@ makeStakePoolRetirementCertificate req =
$ Ledger.mkRetirePoolTxCert (unStakePoolKeyHash poolId) retirementEpoch

data GenesisKeyDelegationRequirements ere where

GenesisKeyDelegationRequirements
:: ShelleyToBabbageEra era
-> Hash GenesisKey
Expand Down
4 changes: 4 additions & 0 deletions cardano-api/internal/Cardano/Api/ReexposeLedger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ module Cardano.Api.ReexposeLedger
, EraTxCert(..)

-- Core
, Coin (..)
, PoolCert(..)
, addDeltaCoin
, toDeltaCoin
, toEraCBOR
, fromEraCBOR

Expand Down Expand Up @@ -53,6 +56,7 @@ import Cardano.Ledger.Api
import Cardano.Ledger.BaseTypes (DnsName, Url, boundRational, dnsToText,
maybeToStrictMaybe, portToWord16, strictMaybeToMaybe, textToDns, textToUrl,
unboundRational, urlToText)
import Cardano.Ledger.Coin (Coin (..), addDeltaCoin, toDeltaCoin)
import Cardano.Ledger.Conway.TxCert (ConwayCommitteeCert (..), ConwayDelegCert (..),
ConwayEraTxCert (..), ConwayTxCert (..))
import Cardano.Ledger.Core (PoolCert (..), fromEraCBOR, toEraCBOR)
Expand Down
10 changes: 10 additions & 0 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,17 @@ module Cardano.Api (
-- unregistering stake address, and for setting the stake pool delegation
-- choice for a stake address.
StakeAddressRequirements(..),
StakeDelegationRequirements(..),
makeStakeAddressDelegationCertificate,
makeStakeAddressRegistrationCertificate,
makeStakeAddressUnregistrationCertificate,
makeStakeAddressPoolDelegationCertificate,

-- ** Registering stake pools
-- | Certificates that are embedded in transactions for registering and
-- retiring stake pools. This includes updating the stake pool parameters.
StakePoolRegistrationRequirements(..),
StakePoolRetirementRequirements(..),
makeStakePoolRegistrationCertificate,
makeStakePoolRetirementCertificate,
StakePoolParameters,
Expand Down Expand Up @@ -790,6 +794,8 @@ module Cardano.Api (
-- * Special transactions
-- | There are various additional things that can be embedded in a
-- transaction for special operations.
GenesisKeyDelegationRequirements(..),
MirCertificateRequirements(..),
makeMIRCertificate,
makeGenesisKeyDelegationCertificate,
MIRTarget (..),
Expand Down Expand Up @@ -909,6 +915,10 @@ module Cardano.Api (
validateAndHashDRepMetadata,

-- ** Governance related certificates
CommitteeColdkeyResignationRequirements(..),
CommitteeHotKeyAuthorizationRequirements(..),
DRepRegistrationRequirements(..),
DRepUnregistrationRequirements(..),
makeCommitteeColdkeyResignationCertificate,
makeCommitteeHotKeyAuthorizationCertificate,
makeDrepRegistrationCertificate,
Expand Down
3 changes: 3 additions & 0 deletions cardano-api/src/Cardano/Api/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,11 @@ module Cardano.Api.Shelley
fromAlonzoCostModels,
--TODO: arrange not to export these
toShelleyNetwork,
obtainCryptoConstraints,
obtainEraConstraints,
obtainEraPParamsConstraint,
obtainEraCryptoConstraints,
fromShelleyPoolParams,

) where

Expand Down
Loading