@@ -211,84 +211,38 @@ pub trait ProofOfStakeRewardsApi<AccountId> {
211
211
+ From < TokenId >
212
212
+ Into < TokenId > ;
213
213
214
- fn claim_rewards_v2 (
215
- sender : AccountId ,
214
+ fn enable ( liquidity_token_id : Self :: CurrencyId , weight : u8 ) ;
215
+
216
+ fn disable ( liquidity_token_id : Self :: CurrencyId ) ;
217
+
218
+ fn is_enabled (
216
219
liquidity_token_id : Self :: CurrencyId ,
217
- amount : Self :: Balance ,
218
- ) -> DispatchResult ;
220
+ ) -> bool ;
219
221
220
- fn claim_rewards_all_v2 (
222
+ fn claim_rewards_all (
221
223
sender : AccountId ,
222
224
liquidity_token_id : Self :: CurrencyId ,
223
225
) -> Result < Self :: Balance , DispatchError > ;
224
226
225
- fn update_pool_promotion (
226
- liquidity_token_id : TokenId ,
227
- liquidity_mining_issuance_weight : Option < u8 > ,
228
- ) -> DispatchResult ;
229
-
230
- fn activate_liquidity_v2 (
227
+ // Activation & deactivation should happen in PoS
228
+ fn activate_liquidity (
231
229
sender : AccountId ,
232
230
liquidity_token_id : Self :: CurrencyId ,
233
231
amount : Self :: Balance ,
234
232
use_balance_from : Option < ActivateKind > ,
235
233
) -> DispatchResult ;
236
234
237
- fn deactivate_liquidity_v2 (
235
+ // Activation & deactivation should happen in PoS
236
+ fn deactivate_liquidity (
238
237
sender : AccountId ,
239
238
liquidity_token_id : Self :: CurrencyId ,
240
239
amount : Self :: Balance ,
241
240
) -> DispatchResult ;
242
241
243
- fn current_rewards_time ( ) -> Option < u32 > ;
244
-
245
- fn calculate_rewards_amount_v2 (
242
+ fn calculate_rewards_amount (
246
243
user : AccountId ,
247
244
liquidity_asset_id : Self :: CurrencyId ,
248
245
) -> Result < Balance , DispatchError > ;
249
-
250
- fn set_liquidity_minting_checkpoint_v2 (
251
- user : AccountId ,
252
- liquidity_asset_id : Self :: CurrencyId ,
253
- liquidity_assets_added : Self :: Balance ,
254
- use_balance_from : Option < ActivateKind > ,
255
- ) -> DispatchResult ;
256
-
257
- fn set_liquidity_burning_checkpoint_v2 (
258
- user : AccountId ,
259
- liquidity_asset_id : Self :: CurrencyId ,
260
- liquidity_assets_burned : Self :: Balance ,
261
- ) -> DispatchResult ;
262
- }
263
-
264
- pub trait CumulativeWorkRewardsApi {
265
- type AccountId : Parameter
266
- + Member
267
- + MaybeSerializeDeserialize
268
- + Debug
269
- + MaybeDisplay
270
- + Ord
271
- + MaxEncodedLen ;
272
-
273
- fn get_pool_rewards_v2 ( liquidity_asset_id : TokenId ) -> Option < U256 > ;
274
-
275
- fn claim_rewards_all_v2 (
276
- user : Self :: AccountId ,
277
- liquidity_asset_id : TokenId ,
278
- ) -> Result < Balance , DispatchError > ;
279
-
280
- fn set_liquidity_minting_checkpoint_v2 (
281
- user : Self :: AccountId ,
282
- liquidity_asset_id : TokenId ,
283
- liquidity_assets_added : Balance ,
284
- use_balance_from : Option < ActivateKind > ,
285
- ) -> DispatchResult ;
286
-
287
- fn set_liquidity_burning_checkpoint_v2 (
288
- user : Self :: AccountId ,
289
- liquidity_asset_id : TokenId ,
290
- liquidity_assets_burned : Balance ,
291
- ) -> DispatchResult ;
292
246
}
293
247
294
248
pub trait PreValidateSwaps {
@@ -474,30 +428,8 @@ pub trait PoolCreateApi {
474
428
) -> Option < ( TokenId , Balance ) > ;
475
429
}
476
430
477
- pub trait RewardsApi {
478
- type AccountId : Parameter
479
- + Member
480
- + MaybeSerializeDeserialize
481
- + Debug
482
- + MaybeDisplay
483
- + Ord
484
- + MaxEncodedLen ;
485
-
486
- /// checks whether given pool is promoted and tokens
487
- /// can be activated
488
- fn can_activate ( liquidity_asset_id : TokenId ) -> bool ;
489
-
490
- /// Activates liquidity tokens for rewards minting
491
- fn activate_liquidity_tokens (
492
- user : & Self :: AccountId ,
493
- liquidity_asset_id : TokenId ,
494
- amount : Balance ,
495
- ) -> DispatchResult ;
496
-
497
- fn update_pool_promotion (
498
- liquidity_token_id : TokenId ,
499
- liquidity_mining_issuance_weight : Option < u8 > ,
500
- ) ;
431
+ pub trait LiquidityMiningApi {
432
+ fn distribute_rewards ( liquidity_mining_rewards : Balance ) ;
501
433
}
502
434
503
435
pub trait AssetRegistryApi {
0 commit comments