Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- getUTxO ∷ NewEpochState era → UTxO era
- getUTxOSubset ∷ NewEpochState era → Set TxIn → UTxO era
- getFilteredUTxO ∷ EraTxOut era ⇒ NewEpochState era → Set Addr → UTxO era
- getPools ∷ NewEpochState era → Set (KeyHash 'StakePool)
- getPoolParameters ∷ NewEpochState era → Set (KeyHash 'StakePool) → Map (KeyHash 'StakePool) PoolParams
- getTotalStake ∷ Globals → NewEpochState era → Coin
- poolsByTotalStakeFraction ∷ ∀ era. EraGov era ⇒ Globals → NewEpochState era → PoolDistr
- data RewardInfoPool = RewardInfoPool {}
- data RewardParams = RewardParams {}
- getRewardInfoPools ∷ EraGov era ⇒ Globals → NewEpochState era → (RewardParams, Map (KeyHash 'StakePool) RewardInfoPool)
- getRewardProvenance ∷ ∀ era. EraGov era ⇒ Globals → NewEpochState era → (RewardUpdate, RewardProvenance)
- getNonMyopicMemberRewards ∷ EraGov era ⇒ Globals → NewEpochState era → Set (Either Coin (Credential 'Staking)) → Map (Either Coin (Credential 'Staking)) (Map (KeyHash 'StakePool) Coin)
- addKeyWitnesses ∷ EraTx era ⇒ Tx era → Set (WitVKey 'Witness) → Tx era
- data AdaPots = AdaPots {}
- totalAdaES ∷ (EraTxOut era, EraGov era) ⇒ EpochState era → Coin
- totalAdaPotsES ∷ (EraTxOut era, EraGov era) ⇒ EpochState era → AdaPots
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 ∷ NewEpochState era → Set (KeyHash 'StakePool) Source #
Get the current registered stake pools.
getPoolParameters ∷ NewEpochState era → Set (KeyHash 'StakePool) → Map (KeyHash 'StakePool) PoolParams Source #
Get the current registered stake pool parameters for a given set of stake pools. The result map will contain entries for all the given stake pools that are currently registered.
getTotalStake ∷ Globals → NewEpochState era → Coin Source #
Calculate the current total stake.
poolsByTotalStakeFraction ∷ ∀ era. EraGov 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
RewardInfoPool | |
|
Instances
data RewardParams Source #
Global information that influences stake pool rewards
RewardParams | |
|
Instances
getRewardInfoPools ∷ EraGov 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 ∷ ∀ era. EraGov 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 ⇒ 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
Ada pots
Instances
totalAdaES ∷ (EraTxOut era, EraGov era) ⇒ EpochState era → Coin Source #
Calculate the total ada in the epoch state
totalAdaPotsES ∷ (EraTxOut era, EraGov era) ⇒ EpochState era → AdaPots Source #
Calculate the total ada pots in the epoch state