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

Cardano.Ledger.Api.State.Query

Synopsis

GetFilteredDelegationsAndRewardAccounts

filterStakePoolDelegsAndRewardsUMapSet (Credential 'Staking) → (Map (Credential 'Staking) (KeyHash 'StakePool), Map (Credential 'Staking) Coin) Source #

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

queryStakePoolDelegsAndRewardsNewEpochState era → Set (Credential 'Staking) → (Map (Credential 'Staking) (KeyHash 'StakePool), Map (Credential 'Staking) 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)

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) DRepState 

Query DRep state.

GetDRepStakeDistr

queryDRepStakeDistr Source #

Arguments

ConwayEraGov era 
NewEpochState era 
Set DRep

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 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.

GetRegisteredDRepStakeDistr

queryRegisteredDRepStakeDistr Source #

Arguments

ConwayEraGov era 
NewEpochState era 
Set (Credential 'DRepRole)

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

Map (Credential 'DRepRole) Coin 

Query the stake distribution of the registered DReps. This does not include the AlwaysAbstain and NoConfidence DReps.

GetSPOStakeDistr

querySPOStakeDistr Source #

Arguments

ConwayEraGov era 
NewEpochState era 
Set (KeyHash 'StakePool) 
Map (KeyHash 'StakePool) 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)

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

Set (Credential 'HotCommitteeRole)

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 

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

GetAccountState

data CommitteeMemberState Source #

Constructors

CommitteeMemberState 

Fields

Instances

Instances details
ToJSON CommitteeMemberState Source # 
Instance details

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

Generic CommitteeMemberState Source # 
Instance details

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

Associated Types

type Rep CommitteeMemberStateTypeType Source #

Show CommitteeMemberState Source # 
Instance details

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

DecCBOR CommitteeMemberState Source # 
Instance details

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

EncCBOR CommitteeMemberState Source # 
Instance details

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

Eq CommitteeMemberState Source # 
Instance details

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

Ord CommitteeMemberState Source # 
Instance details

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

type Rep CommitteeMemberState Source # 
Instance details

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

type Rep CommitteeMemberState = D1 ('MetaData "CommitteeMemberState" "Cardano.Ledger.Api.State.Query.CommitteeMembersState" "cardano-ledger-api-1.11.0.0-inplace" 'False) (C1 ('MetaCons "CommitteeMemberState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cmsHotCredAuthStatus") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 HotCredAuthStatus) :*: 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 Source #

Constructors

CommitteeMembersState 

Fields

Instances

Instances details
ToJSON CommitteeMembersState Source # 
Instance details

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

Generic CommitteeMembersState Source # 
Instance details

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

Associated Types

type Rep CommitteeMembersStateTypeType Source #

Show CommitteeMembersState Source # 
Instance details

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

DecCBOR CommitteeMembersState Source # 
Instance details

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

EncCBOR CommitteeMembersState Source # 
Instance details

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

Eq CommitteeMembersState Source # 
Instance details

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

Ord CommitteeMembersState Source # 
Instance details

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

type Rep CommitteeMembersState Source # 
Instance details

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

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

data HotCredAuthStatus Source #

Constructors

MemberAuthorized (Credential 'HotCommitteeRole) 
MemberNotAuthorized

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

MemberResigned (Maybe Anchor) 

Instances

Instances details
ToJSON HotCredAuthStatus Source # 
Instance details

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

Generic HotCredAuthStatus Source # 
Instance details

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

Associated Types

type Rep HotCredAuthStatusTypeType Source #

Show HotCredAuthStatus Source # 
Instance details

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

DecCBOR HotCredAuthStatus Source # 
Instance details

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

EncCBOR HotCredAuthStatus Source # 
Instance details

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

Eq HotCredAuthStatus Source # 
Instance details

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

Ord HotCredAuthStatus Source # 
Instance details

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

type Rep HotCredAuthStatus Source # 
Instance details

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

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

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.11.0.0-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.11.0.0-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.

GetProposals

queryProposals Source #

Arguments

ConwayEraGov era 
NewEpochState era 
Set GovActionId

Specify a set of Governance Action IDs to filter the proposals. When this set is empty, all the proposals considered for ratification will be returned.

Seq (GovActionState era) 

Query proposals that are considered for ratification.

GetRatifyState

queryRatifyStateConwayEraGov era ⇒ NewEpochState era → RatifyState era Source #

Query ratification state.

@GetStakePoolDefaultVote

queryStakePoolDefaultVote Source #

Arguments

NewEpochState era 
KeyHash 'StakePool

Specify the key hash of the pool whose default vote should be returned.

DefaultVote 

Query a stake pool's reward account delegatee which determines the pool's default vote in absence of an explicit vote. Note that this is different from the delegatee determined by the credential of the stake pool itself.

data DefaultVote Source #

Default vote that will be used for Stake Pool.

Constructors

DefaultNo

Reward account is delegated to a DRepKeyHash, DRepScriptHash or undelegated: default vote is No.

DefaultAbstain

Reward account is delegated to DRepAlwaysAbstain: default vote is Abstain, except for HardForkInitiation actions.

DefaultNoConfidence

Reward account is delegated to DRepAlwaysNoConfidence: default vote is Yes in case of a NoConfidence action, otherwise No.

Instances

Instances details
Show DefaultVote 
Instance details

Defined in Cardano.Ledger.Conway.Governance

Eq DefaultVote 
Instance details

Defined in Cardano.Ledger.Conway.Governance

For testing