fix generated onTransaction prototype