Is there a way to send tx fees of a pallet to an account? Like transactions fees of pallet X is send to an account. We can split the global tx fees between treasury and other but we want to do it as a per pallet basis.
This is definitely possible, but will require some of your own design and elbow grease to make work.
Specifically, you should look at the
trait OnChargeTransaction: https://paritytech.github.io/substrate/master/pallet_transaction_payment/trait.OnChargeTransaction.html
You can see that
withdraw_fee has a
) -> Result<Self::LiquidityInfo, TransactionValidityError>;
With this, you should be able to see what call is triggering a fee payment to occur. When implementing this trait, you can have a match statement which detects which call is being executed, and then have special logic to handle the fees of that call.
Beyond this, you could also just design a specific fee system for specific pallets, since each pallet has full access to manipulate the balance of a user. There would be no need to touch the transaction fee pallet in this case, however these "extra" fees may be opaque to a user who is not aware of this.