def fee_per_kb(self, network: 'Network') -> Optional[int]:
        """Returns sat/kvB fee to pay for a txn.
        Note: might return None.
        """
        if self.use_dynamic_estimates and constants.net is constants.BitcoinRegtest:
            return FEERATE_FALLBACK_STATIC_FEE

        if self.method == FeeMethod.FEERATE:
            fee_rate = self.value
        elif self.method == FeeMethod.MEMPOOL:
            if network and network.mempool_fees.has_data():
                fee_rate = network.mempool_fees.depth_to_fee(self.get_slider_pos())
            else:
                fee_rate = None
        elif self.method == FeeMethod.ETA:
            if network and network.fee_estimates.has_data():
                fee_rate = network.fee_estimates.eta_to_fee(self.get_slider_pos())
            else:
                fee_rate = None
        else:
            raise Exception(self.method)
        if fee_rate is not None:
            fee_rate = int(fee_rate)
        return fee_rate
Returns sat/kvB fee to pay for a txn.
        Note: might return None.
        
electrum/fee_policy.py