finish swap_with_nonce func