1use crate::blueprints::resource::LiquidFungibleResource;
2use crate::types::*;
3use radix_common::math::Decimal;
45pub trait SystemCostingApi<E> {
6/// Check if costing is enabled.
7fn start_lock_fee(&mut self, amount: Decimal, contingent: bool) -> Result<bool, E>;
89/// Add cost units to the reserve. This should never fail.
10fn lock_fee(&mut self, locked_fee: LiquidFungibleResource, contingent: bool);
1112/// Consume an amount of cost units.
13fn consume_cost_units(&mut self, costing_entry: ClientCostingEntry) -> Result<(), E>;
1415/// Retrieve the cost unit limit for the transaction
16fn execution_cost_unit_limit(&mut self) -> Result<u32, E>;
1718/// Retrieve the cost unit price in XRD
19fn execution_cost_unit_price(&mut self) -> Result<Decimal, E>;
2021/// Retrieve the finalization cost unit limit
22fn finalization_cost_unit_limit(&mut self) -> Result<u32, E>;
2324/// Retrieve the finalization cost unit price in XRD
25fn finalization_cost_unit_price(&mut self) -> Result<Decimal, E>;
2627/// Retrieve the usd price of XRD
28fn usd_price(&mut self) -> Result<Decimal, E>;
2930/// Retrieve the maximum allowable royalty per function
31fn max_per_function_royalty_in_xrd(&mut self) -> Result<Decimal, E>;
3233/// Retrieve the tip percentage of the transaction
34fn tip_percentage_truncated(&mut self) -> Result<u32, E>;
3536/// Retrieve the current fee balance in XRD
37fn fee_balance(&mut self) -> Result<Decimal, E>;
38}