2020-09-27 18:06:31 +08:00
|
|
|
#include"Boss/Mod/BoltzSwapper/Env.hpp"
|
|
|
|
|
#include"Boss/Mod/BoltzSwapper/Main.hpp"
|
|
|
|
|
#include"Boss/Mod/BoltzSwapper/ServiceCreator.hpp"
|
|
|
|
|
#include"Util/make_unique.hpp"
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
2021-01-21 16:34:12 +08:00
|
|
|
auto const boltz_instances = std::map< Boss::Msg::Network
|
|
|
|
|
, std::vector<Boss::Mod::BoltzSwapper::Instance>
|
|
|
|
|
>
|
2020-09-27 18:06:31 +08:00
|
|
|
{ { Boss::Msg::Network_Bitcoin
|
2021-01-21 16:34:12 +08:00
|
|
|
/* Historically, the clearnet API endpoint was used as the in-database label
|
|
|
|
|
* for Boltz services.
|
|
|
|
|
* The boltz.exchange service thus uses the API endpoint as the label for
|
|
|
|
|
* back-compatibility.
|
|
|
|
|
* Other services since then were added after we had a separate label.
|
|
|
|
|
*/
|
|
|
|
|
, { { "https://boltz.exchange/api"
|
|
|
|
|
, "https://boltz.exchange/api"
|
|
|
|
|
, "http://boltzzzbnus4m7mta3cxmflnps4fp7dueu2tgurstbvrbt6xswzcocyd.onion/api"
|
|
|
|
|
}
|
|
|
|
|
, { "AutonomousOrganization@github.com"
|
|
|
|
|
, ""
|
|
|
|
|
, "http://jsyqqszgfrya6nj7nhi4hu4tdpuvfursl7dyxeiukzit5mvckqbzxpad.onion"
|
|
|
|
|
}
|
2020-09-27 18:06:31 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
, { Boss::Msg::Network_Testnet
|
2021-01-21 16:34:12 +08:00
|
|
|
, { { "https://testnet.boltz.exchange/api"
|
|
|
|
|
, "https://testnet.boltz.exchange/api"
|
|
|
|
|
, "http://tboltzzrsoc3npe6sydcrh37mtnfhnbrilqi45nao6cgc6dr7n2eo3id.onion/api"
|
|
|
|
|
}
|
2020-09-27 18:06:31 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Boss { namespace Mod { namespace BoltzSwapper {
|
|
|
|
|
|
|
|
|
|
class Main::Impl {
|
|
|
|
|
private:
|
|
|
|
|
Env env;
|
|
|
|
|
ServiceCreator creator;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
Impl(S::Bus& bus, Ev::ThreadPool& threadpool)
|
|
|
|
|
: env(bus)
|
|
|
|
|
, creator(bus, threadpool, env, boltz_instances)
|
|
|
|
|
{ }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Main::Main(Main&&) =default;
|
|
|
|
|
Main& Main::operator=(Main&&) =default;
|
|
|
|
|
Main::~Main() =default;
|
|
|
|
|
|
|
|
|
|
Main::Main( S::Bus& bus
|
|
|
|
|
, Ev::ThreadPool& threadpool
|
|
|
|
|
) : pimpl(Util::make_unique<Impl>(bus, threadpool))
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
}}}
|
|
|
|
|
|