File tree 3 files changed +23
-7
lines changed
3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,24 @@ namespace atomic_dex::mm2
36
36
}
37
37
case CoinType::Matic:
38
38
{
39
- j[" gas_station_url" ] = cfg.is_testnet ? cfg.testnet_matic_gas_station_url : cfg.matic_gas_station_url ;
40
- j[" gas_station_decimals" ] = cfg.matic_gas_station_decimals ;
39
+ if (cfg.is_testnet )
40
+ {
41
+ if (cfg.testnet_matic_gas_station_url .has_value ())
42
+ {
43
+ j[" gas_station_url" ] = cfg.testnet_matic_gas_station_url .value ();
44
+ }
45
+ }
46
+ else
47
+ {
48
+ if (cfg.matic_gas_station_url .has_value ())
49
+ {
50
+ j[" gas_station_url" ] = cfg.matic_gas_station_url .value ();
51
+ }
52
+ }
53
+ if (cfg.matic_gas_station_decimals .has_value ())
54
+ {
55
+ j[" gas_station_decimals" ] = cfg.matic_gas_station_decimals .value ();
56
+ }
41
57
}
42
58
default :
43
59
j[" urls" ] = cfg.urls ;
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ namespace atomic_dex::mm2
34
34
bool is_testnet{false };
35
35
const std::string swap_contract_address;
36
36
std::optional<std::string> fallback_swap_contract_address{std::nullopt};
37
- const std::size_t matic_gas_station_decimals{9 };
37
+ std::optional<std:: size_t > matic_gas_station_decimals{9 };
38
38
std::string gas_station_url{" https://ethgasstation.info/json/ethgasAPI.json" };
39
- std::string matic_gas_station_url{" https://gasstation-mainnet.matic.network/ " };
40
- std::string testnet_matic_gas_station_url{" https://gasstation-mumbai.matic.today/ " };
41
- std::string type; // /< QRC-20 ?
39
+ std::optional<std:: string> matic_gas_station_url{std::nullopt };
40
+ std::optional<std:: string> testnet_matic_gas_station_url{std::nullopt };
41
+ std::optional<std:: string> type; // /< QRC-20 ?
42
42
bool with_tx_history{true };
43
43
};
44
44
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ namespace atomic_dex
33
33
struct coin_config
34
34
{
35
35
static constexpr const char * erc_gas_stations = " https://ethgasstation.info/json/ethgasAPI.json" ;
36
- static constexpr const char * matic_gas_stations = " https://gasstation-mainnet.matic.network/ " ;
36
+ std::optional<std::string> matic_gas_stations{std::nullopt} ;
37
37
using electrum_servers = std::vector<electrum_server>;
38
38
using nodes = std::vector<node>;
39
39
using url_list = std::vector<std::string>;
You can’t perform that action at this time.
0 commit comments