[wallet] refactored code from [blockchain] into [transaction] where it belongs