Skip to content

Commit

Permalink
feat(proxy): use smartcontract in the proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Milerius committed Mar 24, 2021
1 parent 0aa39ee commit 6898a3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/core/atomicdex/config/raw.mm2.coins.cfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace atomic_dex
std::optional<std::string> consensus_branch_id{std::nullopt};
std::optional<double> avg_blocktime{std::nullopt};
std::optional<int64_t> dust{std::nullopt};
nlohmann::json protocol;
};

using coins = std::vector<coin_element>;
Expand Down Expand Up @@ -177,6 +178,7 @@ namespace atomic_dex
x.consensus_branch_id = atomic_dex::get_optional<std::string>(j, "consensus_branch_id");
x.dust = atomic_dex::get_optional<int64_t>(j, "dust");
x.avg_blocktime = atomic_dex::get_optional<double>(j, "avg_blocktime");
x.protocol = j.at("protocol");
}

inline void
Expand Down Expand Up @@ -221,6 +223,7 @@ namespace atomic_dex
to_json_functor("consensus_branch_id", x.consensus_branch_id);
to_json_functor("dust", x.dust);
to_json_functor("avg_blocktime", x.avg_blocktime);
j["protocol"] = x.protocol;
}

inline t_mm2_raw_coins_registry
Expand Down
6 changes: 4 additions & 2 deletions src/core/atomicdex/services/mm2/mm2.service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,8 @@ namespace atomic_dex
}
else
{
out = "/api/v1/erc_tx_history/" + ticker + "/" + address;
const std::string contract_address = get_raw_mm2_ticker_cfg(ticker).at("protocol").at("protocol_data").at("contract_address");
out = "/api/v1/erc_tx_history/" + contract_address + "/" + address;
}
break;
case CoinTypeGadget::BEP20:
Expand All @@ -1069,7 +1070,8 @@ namespace atomic_dex
}
else
{
out = "/api/v1/bep_tx_history/" + ticker + "/" + address;
const std::string contract_address = get_raw_mm2_ticker_cfg(ticker).at("protocol").at("protocol_data").at("contract_address");
out = "/api/v1/bep_tx_history/" + contract_address + "/" + address;
}
default:
break;
Expand Down

0 comments on commit 6898a3d

Please sign in to comment.