Skip to content

Commit

Permalink
Merge pull request #130 from input-output-hk/jordan/expose-more
Browse files Browse the repository at this point in the history
Expose more functionality from cardano-api
  • Loading branch information
Jimbo4350 committed Jul 21, 2023
2 parents ab8c3ea + f3c377f commit 637fba5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
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

0 comments on commit 637fba5

Please sign in to comment.