From 8f483db05ef0a6ff17534e6611882f5df6bc4995 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Mon, 20 Feb 2023 21:39:36 +0100 Subject: [PATCH] ionc swaps implementation: inital code --- src/wallet/wallet2.h | 3 +++ src/wallet/wallets_manager.cpp | 17 +++++++++++++++++ src/wallet/wallets_manager.h | 1 + 3 files changed, 21 insertions(+) diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index b00bbe1b..92772955 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -914,6 +914,9 @@ namespace tools void redeem_htlc(const crypto::hash& htlc_tx_id, const std::string& origin, currency::transaction& result_tx); void redeem_htlc(const crypto::hash& htlc_tx_id, const std::string& origin); bool check_htlc_redeemed(const crypto::hash& htlc_tx_id, std::string& origin, crypto::hash& redeem_tx_id); + + // ionic swaps: + bool create_ionic_swap_proposal(uint64_t wallet_id, const view::ionic_swap_proposal_info& proposal); private: // -------- t_transport_state_notifier ------------------------------------------------ diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp index 63e06328..5d2ce51a 100644 --- a/src/wallet/wallets_manager.cpp +++ b/src/wallet/wallets_manager.cpp @@ -854,6 +854,23 @@ std::string wallets_manager::get_fav_offers(const std::listget()->create_ionic_swap_proposal(proposal); + + } + catch (...) + { + return API_RETURN_CODE_FAIL; + } + return API_RETURN_CODE_OK; + + return true; +} + + std::string wallets_manager::get_my_offers(const bc_services::core_offers_filter& filter, std::list& offers) { if (m_remote_node_mode) diff --git a/src/wallet/wallets_manager.h b/src/wallet/wallets_manager.h index b5c2922f..f744b2db 100644 --- a/src/wallet/wallets_manager.h +++ b/src/wallet/wallets_manager.h @@ -136,6 +136,7 @@ public: std::string backup_wallet(uint64_t wallet_id, const std::wstring& path); std::string reset_wallet_password(uint64_t wallet_id, const std::string& pass); std::string is_wallet_password_valid(uint64_t wallet_id, const std::string& pass); + std::string create_ionic_swap_proposal(uint64_t wallet_id, const view::ionic_swap_proposal_info& proposal); std::string get_my_offers(const bc_services::core_offers_filter& filter, std::list& offers); std::string get_fav_offers(const std::list& hashes, const bc_services::core_offers_filter& filter, std::list& offers); std::string get_tx_pool_info(currency::COMMAND_RPC_GET_POOL_INFO::response& res);