| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Shelley.API.Wallet
Synopsis
- getUTxO ∷ NewEpochState era → UTxO era
- getUTxOSubset ∷ NewEpochState era → Set TxIn → UTxO era
- getFilteredUTxO ∷ EraTxOut era ⇒ NewEpochState era → Set Addr → UTxO era
- getPools ∷ EraCertState era ⇒ NewEpochState era → Set (KeyHash 'StakePool)
- getTotalStake ∷ Globals → NewEpochState era → Coin
- poolsByTotalStakeFraction ∷ (EraGov era, EraStake era, EraCertState era) ⇒ Globals → NewEpochState era → PoolDistr
- data RewardInfoPool = RewardInfoPool {}
- data RewardParams = RewardParams {}
- getRewardInfoPools ∷ (EraGov era, EraStake era, EraCertState era) ⇒ Globals → NewEpochState era → (RewardParams, Map (KeyHash 'StakePool) RewardInfoPool)
- getRewardProvenance ∷ (EraGov era, EraCertState era) ⇒ Globals → NewEpochState era → (RewardUpdate, RewardProvenance)
- getNonMyopicMemberRewards ∷ (EraGov era, EraStake era, EraCertState era) ⇒ Globals → NewEpochState era → Set (Either Coin (Credential 'Staking)) → Map (Either Coin (Credential 'Staking)) (Map (KeyHash 'StakePool) Coin)
- addKeyWitnesses ∷ ∀ era (t ∷ TxLevel). EraTx era ⇒ Tx t era → Set (WitVKey 'Witness) → Tx t era
- data AdaPots = AdaPots {}
- totalAdaES ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ EpochState era → Coin
- totalAdaPotsES ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ EpochState era → AdaPots
- getStakePools ∷ EraCertState era ⇒ NewEpochState era → Set (KeyHash 'StakePool) → Map (KeyHash 'StakePool) StakePoolState
UTxOs
getUTxO ∷ NewEpochState era → UTxO era Source #
Get the full UTxO.
getUTxOSubset ∷ NewEpochState era → Set TxIn → UTxO era Source #
getFilteredUTxO ∷ EraTxOut era ⇒ NewEpochState era → Set Addr → UTxO era Source #
Get the UTxO filtered by address.
Stake Pools
getPools ∷ EraCertState era ⇒ NewEpochState era → Set (KeyHash 'StakePool) Source #
Get the current registered stake pools.
getTotalStake ∷ Globals → NewEpochState era → Coin Source #
Calculate the current total stake.
poolsByTotalStakeFraction ∷ (EraGov era, EraStake era, EraCertState era) ⇒ Globals → NewEpochState era → PoolDistr Source #
Get pool sizes, but in terms of total stake
The stake distribution uses active stake (so that the leader schedule is not affected by undelegated stake), but the wallet wants to display pool saturation for rewards purposes. For that, it needs the fraction of total stake.
The fields individualTotalPoolStake and pdTotalActiveStake continue to
remain based on active stake and not total stake.
This is not based on any snapshot, but uses the current ledger state.
data RewardInfoPool Source #
Information about a stake pool
Constructors
| RewardInfoPool | |
Fields
| |
Instances
data RewardParams Source #
Global information that influences stake pool rewards
Constructors
| RewardParams | |
Fields
| |
Instances
| FromJSON RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet Methods parseJSON ∷ Value → Parser RewardParams Source # parseJSONList ∷ Value → Parser [RewardParams] Source # | |||||
| ToJSON RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet Methods toJSON ∷ RewardParams → Value Source # toEncoding ∷ RewardParams → Encoding Source # toJSONList ∷ [RewardParams] → Value Source # toEncodingList ∷ [RewardParams] → Encoding Source # omitField ∷ RewardParams → Bool Source # | |||||
| DecCBOR RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet | |||||
| EncCBOR RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet Methods | |||||
| NFData RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet Methods rnf ∷ RewardParams → () # | |||||
| Generic RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet Associated Types
| |||||
| Show RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet Methods showsPrec ∷ Int → RewardParams → ShowS # show ∷ RewardParams → String # showList ∷ [RewardParams] → ShowS # | |||||
| Eq RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet | |||||
| NoThunks RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet | |||||
| type Rep RewardParams Source # | |||||
Defined in Cardano.Ledger.Shelley.API.Wallet type Rep RewardParams = D1 ('MetaData "RewardParams" "Cardano.Ledger.Shelley.API.Wallet" "cardano-ledger-shelley-1.18.0.0-inplace" 'False) (C1 ('MetaCons "RewardParams" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nOpt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16) :*: S1 ('MetaSel ('Just "a0") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NonNegativeInterval)) :*: (S1 ('MetaSel ('Just "rPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: S1 ('MetaSel ('Just "totalStake") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin)))) | |||||
getRewardInfoPools ∷ (EraGov era, EraStake era, EraCertState era) ⇒ Globals → NewEpochState era → (RewardParams, Map (KeyHash 'StakePool) RewardInfoPool) Source #
Retrieve the information necessary to calculate stake pool member rewards from the current stake distribution.
This information includes the current stake distribution aggregated
by stake pools and pool owners,
the current pool costs and margins,
and performance estimates.
Also included are global information such as
the total stake or protocol parameters.
getRewardProvenance ∷ (EraGov era, EraCertState era) ⇒ Globals → NewEpochState era → (RewardUpdate, RewardProvenance) Source #
Calculate stake pool rewards from the snapshot labeled go.
Also includes information on how the rewards were calculated
(RewardProvenance).
For a calculation of rewards based on the current stake distribution,
see getRewardInfoPools.
TODO: Deprecate getRewardProvenance, because wallets are more
likely to use getRewardInfoPools for up-to-date information
on stake pool rewards.
getNonMyopicMemberRewards ∷ (EraGov era, EraStake era, EraCertState era) ⇒ Globals → NewEpochState era → Set (Either Coin (Credential 'Staking)) → Map (Either Coin (Credential 'Staking)) (Map (KeyHash 'StakePool) Coin) Source #
Calculate the Non-Myopic Pool Member Rewards for a set of credentials. For each given credential, this function returns a map from each stake pool (identified by the key hash of the pool operator) to the non-myopic pool member reward for that stake pool.
This is not based on any snapshot, but uses the current ledger state.
Transaction helpers
addKeyWitnesses ∷ ∀ era (t ∷ TxLevel). EraTx era ⇒ Tx t era → Set (WitVKey 'Witness) → Tx t era Source #
Ada pots
Constructors
| AdaPots | |
Fields | |
Instances
| NFData AdaPots Source # | |||||
Defined in Cardano.Ledger.Shelley.AdaPots | |||||
| Generic AdaPots Source # | |||||
Defined in Cardano.Ledger.Shelley.AdaPots Associated Types
| |||||
| Show AdaPots Source # | |||||
| Eq AdaPots Source # | |||||
| type Rep AdaPots Source # | |||||
Defined in Cardano.Ledger.Shelley.AdaPots type Rep AdaPots = D1 ('MetaData "AdaPots" "Cardano.Ledger.Shelley.AdaPots" "cardano-ledger-shelley-1.18.0.0-inplace" 'False) (C1 ('MetaCons "AdaPots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "treasuryAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: (S1 ('MetaSel ('Just "reservesAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: S1 ('MetaSel ('Just "rewardsAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin))) :*: (S1 ('MetaSel ('Just "utxoAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: (S1 ('MetaSel ('Just "feesAdaPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: S1 ('MetaSel ('Just "obligationsPot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Obligations))))) | |||||
totalAdaES ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ EpochState era → Coin Source #
Calculate the total ada in the epoch state
totalAdaPotsES ∷ (EraTxOut era, EraGov era, EraCertState era) ⇒ EpochState era → AdaPots Source #
Calculate the total ada pots in the epoch state
getStakePools ∷ EraCertState era ⇒ NewEpochState era → Set (KeyHash 'StakePool) → Map (KeyHash 'StakePool) StakePoolState Source #
Get the current registered stake pool state for a given set of stake pools. The result map will contain entries for all the given stake pools that are currently registered.