protected function determineFee($utxos, $outputs, $feeStrategy, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) {

        $size = SizeEstimation::estimateVsize($utxos, $outputs);

        switch ($feeStrategy) {
            case self::FEE_STRATEGY_BASE_FEE:
                return self::baseFeeForSize($size);

            case self::FEE_STRATEGY_HIGH_PRIORITY:
                return (int)round(($size / 1000) * $highPriorityFeePerKB);

            case self::FEE_STRATEGY_OPTIMAL:
                return (int)round(($size / 1000) * $optimalFeePerKB);

            case self::FEE_STRATEGY_LOW_PRIORITY:
                return (int)round(($size / 1000) * $lowPriorityFeePerKB);

            case self::FEE_STRATEGY_FORCE_FEE:
                throw new BlocktrailSDKException("Can't determine when for force_fee");

            default:
                throw new BlocktrailSDKException("Unknown feeStrategy [{$feeStrategy}]");
        }
    }
protected function determineFee($utxos, $outputs, $feeStrategy, $highPriorityFeePerKB, $optimalFeePerKB, $lowPriorityFeePerKB) {

        $size = SizeEstimation::estimateVsize($utxos, $outputs);

        switch ($feeStrategy) {
            case self::FEE_STRATEGY_BASE_FEE:
                return self::baseFeeForSize($size);

            case self::FEE_STRATEGY_HIGH_PRIORITY:
                return (int)round(($size / 1000) * $highPriorityFeePerKB);

            case self::FEE_STRATEGY_OPTIMAL:
                return (int)round(($size / 1000) * $optimalFeePerKB);

            case self::FEE_STRATEGY_LOW_PRIORITY:
                return (int)round(($size / 1000) * $lowPriorityFeePerKB);

            case self::FEE_STRATEGY_FORCE_FEE:
                throw new BlocktrailSDKException("Can't determine when for force_fee");

            default:
                throw new BlocktrailSDKException("Unknown feeStrategy [{$feeStrategy}]");
        }
    }
protected function determineFee ( $ utxos , $ outputs , $ feeStrategy , $ highPriorityFeePerKB , $ optimalFeePerKB , $ lowPriorityFeePerKB ) { $ size = SizeEstimation :: estimateVsize ( $ utxos , $ outputs ) ; switch ( $ feeStrategy ) { case self :: FEE_STRATEGY_BASE_FEE : return self :: baseFeeForSize ( $ size ) ; case self :: FEE_STRATEGY_HIGH_PRIORITY : return ( int ) round ( ( $ size / 1000 ) * $ highPriorityFeePerKB ) ; case self :: FEE_STRATEGY_OPTIMAL : return ( int ) round ( ( $ size / 1000 ) * $ optimalFeePerKB ) ; case self :: FEE_STRATEGY_LOW_PRIORITY : return ( int ) round ( ( $ size / 1000 ) * $ lowPriorityFeePerKB ) ; case self :: FEE_STRATEGY_FORCE_FEE : throw new BlocktrailSDKException ( "Can't determine when for force_fee" ) ; default : throw new BlocktrailSDKException ( "Unknown feeStrategy [{$feeStrategy}]" ) ; } }
determine how much fee is required based on the inputs and outputs
this is an estimation, not a proper 100% correct calculation

@param UTXO[]  $utxos
@param array[] $outputs
@param         $feeStrategy
@param         $highPriorityFeePerKB
@param         $optimalFeePerKB
@param         $lowPriorityFeePerKB
@return int
@throws BlocktrailSDKException
determine how much fee is required based on the inputs and outputs this is an estimation not a proper 100% correct calculation