Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into cipi
Browse files Browse the repository at this point in the history
  • Loading branch information
cipig committed Oct 3, 2022
2 parents 9ae96a9 + e0bc825 commit e26249c
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 91 deletions.
76 changes: 5 additions & 71 deletions assets/config/0.5.6-coins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3698,22 +3698,6 @@
"active": false,
"currently_enabled": false
},
"JSTR": {
"coin": "JSTR",
"name": "Ropsten test ERC20",
"coinpaprika_id": "test-coin",
"coingecko_id": "test-coin",
"is_testnet": true,
"nodes": [
"https://ropsten.infura.io/v3/1d059a9aca7d49a3a380c71068bffb1c"
],
"explorer_url": [
"https://ropsten.etherscan.io/"
],
"type": "ERC-20",
"active": false,
"currently_enabled": false
},
"JUMBLR": {
"coin": "JUMBLR",
"name": "JUMBLR",
Expand Down Expand Up @@ -4822,56 +4806,6 @@
"type": "Arbitrum",
"name": "Ethereum"
},
"ETHK-OPT20": {
"active": false,
"wallet_only": true,
"coin": "ETHK-OPT20",
"coingecko_id": "test-coin",
"coinpaprika_id": "test-coin",
"currently_enabled": false,
"is_testnet": true,
"nodes": [
"https://kovan.optimism.io"
],
"explorer_url": [
"https://kovan-optimistic.etherscan.io/"
],
"type": "Optimism",
"name": "EthKovan Optimism (Testnet)"
},
"ETHR-ARB20": {
"active": false,
"wallet_only": true,
"coin": "ETHR-ARB20",
"coingecko_id": "test-coin",
"coinpaprika_id": "test-coin",
"currently_enabled": false,
"is_testnet": true,
"nodes": [
"https://rinkeby.arbitrum.io/rpc"
],
"explorer_url": [
"https://rinkeby-explorer.arbitrum.io/#/"
],
"type": "Arbitrum",
"name": "EthRinkeby Arbitrum (Testnet)"
},
"ETHR": {
"active": false,
"coin": "ETHR",
"coingecko_id": "test-coin",
"coinpaprika_id": "test-coin",
"currently_enabled": false,
"is_testnet": true,
"nodes": [
"https://ropsten.infura.io/v3/1d059a9aca7d49a3a380c71068bffb1c"
],
"explorer_url": [
"https://ropsten.etherscan.io/"
],
"type": "ERC-20",
"name": "Ethereum Ropsten (Testnet)"
},
"UIS": {
"coin": "UIS",
"name": "Unitus",
Expand Down Expand Up @@ -5813,7 +5747,7 @@
"coin": "NYAN",
"name": "Nyancoin",
"coinpaprika_id": "nyan-nyancoin",
"coingecko_id": "test-coin",
"coingecko_id": "nyancoin",
"nomics_id": "NYAN",
"electrum": [
{
Expand Down Expand Up @@ -5871,7 +5805,7 @@
"PGX-PLG20": {
"coin": "PGX-PLG20",
"name": "Pegaxy Stone",
"coinpaprika_id": "test-coin",
"coinpaprika_id": "pgx-pegaxy-stone",
"coingecko_id": "pegaxy-stone",
"nomics_id": "PGX",
"nodes": [
Expand Down Expand Up @@ -9881,7 +9815,7 @@
"coin": "PRCY-BEP20",
"name": "PRivaCY Coin",
"coinpaprika_id": "prcy-privacy-coin",
"coingecko_id": "privacy-coin",
"coingecko_id": "prcy-coin",
"nomics_id": "PRCY",
"nodes": [
"http://bsc1.cipig.net:8655",
Expand All @@ -9899,7 +9833,7 @@
"coin": "PRCY-ERC20",
"name": "PRivaCY Coin",
"coinpaprika_id": "prcy-privacy-coin",
"coingecko_id": "privacy-coin",
"coingecko_id": "prcy-coin",
"nomics_id": "PRCY",
"nodes": [
"http://eth1.cipig.net:8555",
Expand All @@ -9917,7 +9851,7 @@
"coin": "PRCY-PLG20",
"name": "PRivaCY Coin",
"coinpaprika_id": "prcy-privacy-coin",
"coingecko_id": "privacy-coin",
"coingecko_id": "prcy-coin",
"nomics_id": "PRCY",
"nodes": [
"https://polygon-rpc.com",
Expand Down
12 changes: 10 additions & 2 deletions atomic_defi_design/Dex/Exchange/ProView/Chart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import QtWebEngine 1.8
import "../../Components"
import "../../Constants"
import Dex.Themes 1.0 as Dex
import AtomicDEX.MarketMode 1.0

Item
{
Expand Down Expand Up @@ -182,9 +183,16 @@ Item
Connections
{
target: app
function onPairChanged()
function onPairChanged(left, right)
{
root.loadChart(left_ticker, right_ticker)
if (API.app.trading_pg.market_mode == MarketMode.Sell)
{
root.loadChart(left, right)
}
else
{
root.loadChart(right, left)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Item
placeOrderForm.visible = General.flipFalse(placeOrderForm.visible)
if (API.app.trading_pg.market_mode == MarketMode.Buy)
{
app.pairChanged(rel_ticker, coin)
app.pairChanged(coin, rel_ticker)
}
else
{
Expand Down
7 changes: 5 additions & 2 deletions src/app/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ namespace atomic_dex
!coins.contains(QString::fromStdString(coin_info.fees_ticker)))
{
auto coin_parent_info = mm2.get_coin_info(coin_info.fees_ticker);
if (!coin_parent_info.currently_enabled && !coin_parent_info.active && extra_coins.insert(coin_parent_info.ticker).second)
if (coin_parent_info.ticker != "")
{
SPDLOG_INFO("Adding extra coin: {} to enable", coin_parent_info.ticker);
if (!coin_parent_info.currently_enabled && !coin_parent_info.active && extra_coins.insert(coin_parent_info.ticker).second)
{
SPDLOG_INFO("Adding extra coin: {} to enable", coin_parent_info.ticker);
}
}
}
coins_std.push_back(coin.toStdString());
Expand Down
10 changes: 4 additions & 6 deletions src/core/atomicdex/api/mm2/rpc.enable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ namespace atomic_dex::mm2
case CoinType::Optimism:
{
j["urls"] = cfg.urls;
j["swap_contract_address"] = cfg.is_testnet ? cfg.optimism_erc_testnet_swap_contract_address : cfg.optimism_erc_swap_contract_address;
j["fallback_swap_contract"] =
cfg.is_testnet ? cfg.optimism_erc_testnet_fallback_swap_contract_address : cfg.optimism_erc_fallback_swap_contract_address;
j["swap_contract_address"] = cfg.optimism_erc_swap_contract_address;
j["fallback_swap_contract"] = cfg.optimism_erc_fallback_swap_contract_address;
break;
}
case CoinType::Arbitrum:
{
j["urls"] = cfg.urls;
j["swap_contract_address"] = cfg.is_testnet ? cfg.arbitrum_erc_testnet_swap_contract_address : cfg.arbitrum_erc_swap_contract_address;
j["fallback_swap_contract"] =
cfg.is_testnet ? cfg.arbitrum_erc_testnet_fallback_swap_contract_address : cfg.arbitrum_erc_fallback_swap_contract_address;
j["swap_contract_address"] = cfg.arbitrum_erc_swap_contract_address;
j["fallback_swap_contract"] = cfg.arbitrum_erc_fallback_swap_contract_address;
break;
}
case CoinType::BEP20:
Expand Down
4 changes: 0 additions & 4 deletions src/core/atomicdex/api/mm2/rpc.enable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@ namespace atomic_dex::mm2
const std::string matic_erc_testnet_fallback_swap_contract_address{"0x73c1Dd989218c3A154C71Fc08Eb55A24Bd2B3A10"};
const std::string optimism_erc_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string optimism_erc_fallback_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string optimism_erc_testnet_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string optimism_erc_testnet_fallback_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string arbitrum_erc_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string arbitrum_erc_fallback_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string arbitrum_erc_testnet_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string arbitrum_erc_testnet_fallback_swap_contract_address{"0x9130b257d37a52e52f21054c4da3450c72f595ce"};
const std::string sbch_erc_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"};
const std::string sbch_erc_fallback_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"};
const std::string sbch_erc_testnet_swap_contract_address{"0x25bF2AAB8749AD2e4360b3e0B738f3Cd700C4D68"};
Expand Down
12 changes: 9 additions & 3 deletions src/core/atomicdex/config/coins.cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ namespace
{
return CoinType::ZHTLC;
}
throw std::invalid_argument{"Undefined given coin type."};
SPDLOG_INFO("Invalid coin type: {}", coin_type);
return CoinType::Invalid;
// throw std::invalid_argument{"Undefined given coin type."};
}
}

Expand Down Expand Up @@ -222,12 +224,12 @@ namespace atomic_dex
break;
case CoinType::Optimism:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "ETHK-OPT20" : "ETH-OPT20";
cfg.fees_ticker = "ETH-OPT20";
cfg.is_erc_family = true;
break;
case CoinType::Arbitrum:
cfg.has_parent_fees_ticker = true;
cfg.fees_ticker = cfg.is_testnet.value() ? "ETHR-ARB20" : "ETH-ARB20";
cfg.fees_ticker = "ETH-ARB20";
cfg.is_erc_family = true;
break;
case CoinType::AVX20:
Expand Down Expand Up @@ -294,6 +296,10 @@ namespace atomic_dex
cfg.is_zhtlc_family = true;
cfg.fees_ticker = cfg.ticker;
break;
case CoinType::Invalid:
cfg.has_parent_fees_ticker = false;
cfg.fees_ticker = cfg.ticker;
break;
default:
cfg.has_parent_fees_ticker = false;
cfg.fees_ticker = cfg.ticker;
Expand Down
5 changes: 3 additions & 2 deletions src/core/atomicdex/constants/qt.coins.enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ namespace atomic_dex
RSK = 19,
ZHTLC = 20,
Disabled = 21,
All = 22,
Size = 23
Invalid = 22,
All = 23,
Size = 24
};

Q_ENUM(CoinTypeEnum)
Expand Down

0 comments on commit e26249c

Please sign in to comment.