@@ -37,6 +37,9 @@ module Cardano.Ledger.Shelley.API.Wallet (
3737 totalAdaES ,
3838 totalAdaPotsES ,
3939 getStakePools ,
40+
41+ -- * Snapshots
42+ currentSnapshot ,
4043) where
4144
4245import Cardano.Ledger.Address (compactAddr )
@@ -122,6 +125,10 @@ getUTxO ::
122125 NewEpochState era ->
123126 UTxO era
124127getUTxO = utxosUtxo . lsUTxOState . esLState . nesEs
128+ {-# DEPRECATED
129+ getUTxO
130+ "Use queryUTxOFull from Cardano.Ledger.Api.State.Query.UTxO instead."
131+ #-}
125132
126133-- | Get the UTxO filtered by address.
127134getFilteredUTxO ::
@@ -139,12 +146,20 @@ getFilteredUTxO ss addrSet =
139146 Left addr -> addr `Set.member` addrSet
140147 Right cAddr -> cAddr `Set.member` compactAddrSet
141148{-# INLINEABLE getFilteredUTxO #-}
149+ {-# DEPRECATED
150+ getFilteredUTxO
151+ "Use queryUTxOByAddress from Cardano.Ledger.Api.State.Query.UTxO instead."
152+ #-}
142153
143154getUTxOSubset ::
144155 NewEpochState era ->
145156 Set TxIn ->
146157 UTxO era
147158getUTxOSubset nes = txInsFilter (getUTxO nes)
159+ {-# DEPRECATED
160+ getUTxOSubset
161+ "Use queryUTxOByTxIn from Cardano.Ledger.Api.State.Query.UTxO instead."
162+ #-}
148163
149164--------------------------------------------------------------------------------
150165-- Stake pools and pool rewards
@@ -158,6 +173,10 @@ getPools ::
158173getPools = Map. keysSet . f
159174 where
160175 f nes = nes ^. nesEsL . esLStateL . lsCertStateL . certPStateL . psStakePoolsL
176+ {-# DEPRECATED
177+ getPools
178+ "Use queryStakePools from Cardano.Ledger.Api.State.Query.Pool instead."
179+ #-}
161180
162181-- | Get the /current/ registered stake pool state for a given set of
163182-- stake pools. The result map will contain entries for all the given stake
@@ -170,6 +189,10 @@ getStakePools ::
170189getStakePools = Map. restrictKeys . f
171190 where
172191 f nes = nes ^. nesEsL . esLStateL . lsCertStateL . certPStateL . psStakePoolsL
192+ {-# DEPRECATED
193+ getStakePools
194+ "Use queryPoolState or queryStakePoolParams from Cardano.Ledger.Api.State.Query.Pool instead."
195+ #-}
173196
174197-- | Get pool sizes, but in terms of total stake
175198--
@@ -200,13 +223,21 @@ poolsByTotalStakeFraction globals nes =
200223 IndividualPoolStake
201224 toTotalStakeFrac (IndividualPoolStake s c vrf) =
202225 IndividualPoolStake (s * stakeRatio) c vrf
226+ {-# DEPRECATED
227+ poolsByTotalStakeFraction
228+ "Use queryStakePoolDistrByTotalSupply from Cardano.Ledger.Api.State.Query.Pool instead"
229+ #-}
203230
204231-- | Calculate the current total stake.
205232getTotalStake :: Globals -> NewEpochState era -> Coin
206233getTotalStake globals ss =
207234 let supply = Coin . fromIntegral $ maxLovelaceSupply globals
208235 es = nesEs ss
209236 in circulation es supply
237+ {-# DEPRECATED
238+ getTotalStake
239+ "Use 'circulation' from Cardano.Ledger.Shelley.LedgerState instead."
240+ #-}
210241
211242-- | Calculate the Non-Myopic Pool Member Rewards for a set of credentials.
212243-- For each given credential, this function returns a map from each stake
@@ -252,6 +283,10 @@ getNonMyopicMemberRewards globals ss = Map.fromSet nmmRewards
252283 getTopRankedPools rPot totalStakeCoin pp $
253284 Map. intersectionWith (,) (VMap. toMap (VMap. map percentile' ls)) $
254285 VMap. toMap stakePoolsSnapShot
286+ {-# DEPRECATED
287+ getNonMyopicMemberRewards
288+ "Use queryNonMyopicMemberRewards from Cardano.Ledger.Api.State.Query.Reward instead"
289+ #-}
255290
256291-- | Create a current snapshot of the ledger state.
257292--
@@ -266,6 +301,10 @@ currentSnapshot nes =
266301 instantStake = ledgerState ^. instantStakeG
267302 dstate = ledgerState ^. lsCertStateL . certDStateL
268303 pstate = ledgerState ^. lsCertStateL . certPStateL
304+ {-# DEPRECATED
305+ currentSnapshot
306+ "Use queryCurrentSnapshot from Cardano.Ledger.Api.State.Query.Snapshot instead."
307+ #-}
269308
270309-- | Information about a stake pool
271310data RewardInfoPool = RewardInfoPool
@@ -359,17 +398,14 @@ getRewardInfoPools globals nes =
359398 , performanceEstimate =
360399 unPerformanceEstimate $ percentile' $ histLookup poolId
361400 }
401+ {-# DEPRECATED getRewardInfoPools "Use queryRewardInfoPools from Cardano.Ledger.Api.State.Query.Reward instead" #-}
362402
363403-- | Calculate stake pool rewards from the snapshot labeled `go`.
364404-- Also includes information on how the rewards were calculated
365405-- ('RewardProvenance').
366406--
367407-- For a calculation of rewards based on the current stake distribution,
368408-- see 'getRewardInfoPools'.
369- --
370- -- TODO: Deprecate 'getRewardProvenance', because wallets are more
371- -- likely to use 'getRewardInfoPools' for up-to-date information
372- -- on stake pool rewards.
373409getRewardProvenance ::
374410 forall era .
375411 (EraGov era , EraCertState era ) =>
@@ -391,6 +427,7 @@ getRewardProvenance globals newEpochState =
391427 slotsPerEpoch = epochInfoSize (epochInfoPure globals) epochNo
392428 asc = activeSlotCoeff globals
393429 secparam = securityParameter globals
430+ {-# DEPRECATED getRewardProvenance "Use queryRewardProvenance from Cardano.Ledger.Api.State.Query.Reward instead" #-}
394431
395432--------------------------------------------------------------------------------
396433-- Transaction helpers
0 commit comments