Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- getUTxO ∷ NewEpochState era → UTxO era
- getUTxOSubset ∷ NewEpochState era → Set (TxIn (EraCrypto era)) → UTxO era
- getFilteredUTxO ∷ EraTxOut era ⇒ NewEpochState era → Set (Addr (EraCrypto era)) → UTxO era
- getPools ∷ NewEpochState era → Set (KeyHash 'StakePool (EraCrypto era))
- getPoolParameters ∷ NewEpochState era → Set (KeyHash 'StakePool (EraCrypto era)) → Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era))
- getTotalStake ∷ Globals → NewEpochState era → Coin
- poolsByTotalStakeFraction ∷ ∀ era. EraGov era ⇒ Globals → NewEpochState era → PoolDistr (EraCrypto era)
- data RewardInfoPool = RewardInfoPool {}
- data RewardParams = RewardParams {}
- getRewardInfoPools ∷ EraGov era ⇒ Globals → NewEpochState era → (RewardParams, Map (KeyHash 'StakePool (EraCrypto era)) RewardInfoPool)
- getRewardProvenance ∷ ∀ era. EraGov era ⇒ Globals → NewEpochState era → (RewardUpdate (EraCrypto era), RewardProvenance (EraCrypto era))
- getNonMyopicMemberRewards ∷ EraGov era ⇒ Globals → NewEpochState era → Set (Either Coin (Credential 'Staking (EraCrypto era))) → Map (Either Coin (Credential 'Staking (EraCrypto era))) (Map (KeyHash 'StakePool (EraCrypto era)) Coin)
- addKeyWitnesses ∷ EraTx era ⇒ Tx era → Set (WitVKey 'Witness (EraCrypto era)) → Tx era
- evaluateTransactionBalance ∷ EraUTxO era ⇒ PParams era → CertState era → UTxO era → TxBody era → Value era
- evaluateMinLovelaceOutput ∷ EraTxOut era ⇒ PParams era → TxOut era → Coin
- addShelleyKeyWitnesses ∷ (EraTx era, Tx era ~ ShelleyTx era) ⇒ ShelleyTx era → Set (WitVKey 'Witness (EraCrypto era)) → ShelleyTx 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 (EraCrypto era)) → UTxO era Source #
getFilteredUTxO ∷ EraTxOut era ⇒ NewEpochState era → Set (Addr (EraCrypto era)) → UTxO era Source #
Get the UTxO filtered by address.
Stake Pools
getPools ∷ NewEpochState era → Set (KeyHash 'StakePool (EraCrypto era)) Source #
Get the current registered stake pools.
getPoolParameters ∷ NewEpochState era → Set (KeyHash 'StakePool (EraCrypto era)) → Map (KeyHash 'StakePool (EraCrypto era)) (PoolParams (EraCrypto era)) 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 (EraCrypto era) 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 (EraCrypto era)) 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 (EraCrypto era), RewardProvenance (EraCrypto era)) 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 (EraCrypto era))) → Map (Either Coin (Credential 'Staking (EraCrypto era))) (Map (KeyHash 'StakePool (EraCrypto era)) 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
evaluateTransactionBalance Source #
∷ EraUTxO era | |
⇒ PParams era | Current protocol parameters |
→ CertState era | Where the deposit info is stored |
→ UTxO era | The UTxO relevant to the transaction. |
→ TxBody era | The transaction being evaluated for balance. |
→ Value era | The difference between what the transaction consumes and what it produces. |
Deprecated: In favor of new API function evalBalanceTxBody
Evaluate the difference between the value currently being consumed by a transaction and the number of lovelace being produced. This value will be zero for a valid transaction.
evaluateMinLovelaceOutput ∷ EraTxOut era ⇒ PParams era → TxOut era → Coin Source #
Deprecated: In favor of getMinCoinTxOut
Evaluate the minimum lovelace that a given transaction output must contain.
addShelleyKeyWitnesses ∷ (EraTx era, Tx era ~ ShelleyTx era) ⇒ ShelleyTx era → Set (WitVKey 'Witness (EraCrypto era)) → ShelleyTx era Source #
Deprecated: In favor of addKeyWitnesses
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