move transaction from web interface to lib code