cardano-ledger-api-1.9.2.2: Public API for the cardano ledger codebase
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Api.State.Query

Synopsis

GetFilteredDelegationsAndRewardAccounts

filterStakePoolDelegsAndRewardsUMap c → Set (Credential 'Staking c) → (Map (Credential 'Staking c) (KeyHash 'StakePool c), Map (Credential 'Staking c) Coin) Source #

Filter out stake pool delegations and rewards for a set of stake credentials

queryStakePoolDelegsAndRewardsNewEpochState era → Set (Credential 'Staking (EraCrypto era)) → (Map (Credential 'Staking (EraCrypto era)) (KeyHash 'StakePool (EraCrypto era)), Map (Credential 'Staking (EraCrypto era)) Coin) Source #

Uses filterStakePoolDelegsAndRewards to get the same information from the NewEpochState

Implementation for GetFilteredDelegationsAndRewardAccounts query.

GetGovState

queryGovStateNewEpochState era → GovState era Source #

This query returns all of the state related to governance

GetConstitution

GetConstitutionHash

GetDRepState

queryDRepState Source #

Arguments

NewEpochState era 
Set (Credential 'DRepRole (EraCrypto era))

Specify a set of DRep credentials whose state should be returned. When this set is empty, states for all of the DReps will be returned.

Map (Credential 'DRepRole (EraCrypto era)) (DRepState (EraCrypto era)) 

Query DRep state.

GetDRepStakeDistr

queryDRepStakeDistr Source #

Arguments

ConwayEraGov era 
NewEpochState era 
Set (DRep (EraCrypto era))

Specify DRep Ids whose stake distribution should be returned. When this set is empty, distributions for all of the DReps will be returned.

Map (DRep (EraCrypto era)) Coin 

Query DRep stake distribution. Note that this can be an expensive query because there is a chance that current distribution has not been fully computed yet.

GetSPOStakeDistr

querySPOStakeDistr Source #

Arguments

ConwayEraGov era 
NewEpochState era 
Set (KeyHash 'StakePool (EraCrypto era)) 
Map (KeyHash 'StakePool (EraCrypto era)) Coin

Specify pool key hashes whose stake distribution should be returned. When this set is empty, distributions for all of the pools will be returned.

Query pool stake distribution.

GetCommitteeState

queryCommitteeStateNewEpochState era → CommitteeState era Source #

Deprecated: In favor of queryCommitteeMembersState

Query committee members

GetCommitteeMembersState

queryCommitteeMembersState Source #

Arguments

∷ ∀ era. ConwayEraGov era 
Set (Credential 'ColdCommitteeRole (EraCrypto era))

filter by cold credentials (don't filter when empty)

Set (Credential 'HotCommitteeRole (EraCrypto era))

filter by hot credentials (don't filter when empty)

Set MemberStatus

filter by status (don't filter when empty) (useful, for discovering, for example, only active members)

NewEpochState era 
CommitteeMembersState (EraCrypto era) 

Query committee members. Whenever the system is in No Confidence mode this query will return Nothing.

GetAccountState

data CommitteeMemberState c Source #

Constructors

CommitteeMemberState 

Fields

Instances

Instances details
Crypto c ⇒ ToJSON (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Generic (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Associated Types

type Rep (CommitteeMemberState c) ∷ TypeType Source #

Show (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Crypto c ⇒ DecCBOR (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Crypto c ⇒ EncCBOR (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Eq (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Ord (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep (CommitteeMemberState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep (CommitteeMemberState c) = D1 ('MetaData "CommitteeMemberState" "Cardano.Ledger.Api.State.Query.CommitteeMembersState" "cardano-ledger-api-1.9.2.2-inplace" 'False) (C1 ('MetaCons "CommitteeMemberState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cmsHotCredAuthStatus") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HotCredAuthStatus c)) :*: S1 ('MetaSel ('Just "cmsStatus") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 MemberStatus)) :*: (S1 ('MetaSel ('Just "cmsExpiration") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe EpochNo)) :*: S1 ('MetaSel ('Just "cmsNextEpochChange") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NextEpochChange))))

data CommitteeMembersState c Source #

Constructors

CommitteeMembersState 

Fields

Instances

Instances details
Crypto c ⇒ ToJSON (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Generic (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Associated Types

type Rep (CommitteeMembersState c) ∷ TypeType Source #

Show (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Crypto c ⇒ DecCBOR (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Crypto c ⇒ EncCBOR (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Eq (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Ord (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep (CommitteeMembersState c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep (CommitteeMembersState c) = D1 ('MetaData "CommitteeMembersState" "Cardano.Ledger.Api.State.Query.CommitteeMembersState" "cardano-ledger-api-1.9.2.2-inplace" 'False) (C1 ('MetaCons "CommitteeMembersState" 'PrefixI 'True) (S1 ('MetaSel ('Just "csCommittee") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'ColdCommitteeRole c) (CommitteeMemberState c))) :*: (S1 ('MetaSel ('Just "csThreshold") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe UnitInterval)) :*: S1 ('MetaSel ('Just "csEpochNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo))))

data HotCredAuthStatus c Source #

Constructors

MemberAuthorized (Credential 'HotCommitteeRole c) 
MemberNotAuthorized

Member enacted, but no hot credential for voting has been registered

MemberResigned (Maybe (Anchor c)) 

Instances

Instances details
Crypto c ⇒ ToJSON (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Generic (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Associated Types

type Rep (HotCredAuthStatus c) ∷ TypeType Source #

Show (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Crypto c ⇒ DecCBOR (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Crypto c ⇒ EncCBOR (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Eq (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Ord (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep (HotCredAuthStatus c) Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep (HotCredAuthStatus c) = D1 ('MetaData "HotCredAuthStatus" "Cardano.Ledger.Api.State.Query.CommitteeMembersState" "cardano-ledger-api-1.9.2.2-inplace" 'False) (C1 ('MetaCons "MemberAuthorized" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Credential 'HotCommitteeRole c))) :+: (C1 ('MetaCons "MemberNotAuthorized" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "MemberResigned" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Anchor c))))))

data MemberStatus Source #

Constructors

Active 
Expired 
Unrecognized

This can happen when a hot credential for an unknown cold credential exists. Such Committee member will be either removed from the state at the next epoch boundary or enacted as a new member.

Instances

Instances details
ToJSON MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Bounded MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Enum MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Generic MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Associated Types

type Rep MemberStatusTypeType Source #

Show MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

DecCBOR MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

EncCBOR MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Eq MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Ord MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep MemberStatus Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep MemberStatus = D1 ('MetaData "MemberStatus" "Cardano.Ledger.Api.State.Query.CommitteeMembersState" "cardano-ledger-api-1.9.2.2-inplace" 'False) (C1 ('MetaCons "Active" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "Expired" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "Unrecognized" 'PrefixI 'False) (U1TypeType)))

data NextEpochChange Source #

Instances

Instances details
ToJSON NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Generic NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Associated Types

type Rep NextEpochChangeTypeType Source #

Show NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

DecCBOR NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

EncCBOR NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Eq NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

Ord NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep NextEpochChange Source # 
Instance details

Defined in Cardano.Ledger.Api.State.Query.CommitteeMembersState

type Rep NextEpochChange = D1 ('MetaData "NextEpochChange" "Cardano.Ledger.Api.State.Query.CommitteeMembersState" "cardano-ledger-api-1.9.2.2-inplace" 'False) ((C1 ('MetaCons "ToBeEnacted" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "ToBeRemoved" 'PrefixI 'False) (U1TypeType)) :+: (C1 ('MetaCons "NoChangeExpected" 'PrefixI 'False) (U1TypeType) :+: (C1 ('MetaCons "ToBeExpired" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "TermAdjusted" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EpochNo)))))

GetCurrentPParams

queryCurrentPParamsEraGov era ⇒ NewEpochState era → PParams era Source #

This is a simple lookup into the state for the values of current protocol parameters. These values can change on the epoch boundary. Use queryFuturePParams to see if we are aware of any upcoming changes.

GetFuturePParams

queryFuturePParamsEraGov era ⇒ NewEpochState era → Maybe (PParams era) Source #

This query will return values for protocol parameters that are likely to be adopted at the next epoch boundary. It is only when we passed 2 stability windows before the end of the epoch that users can rely on this query to produce stable results.

For testing