MOVEONLY: Move utility functions from rpcwallet to wallet/rpc/util
Summary:
This is a backport of core#23640
Depends on D12774
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12775