1
0

make submarine swap server url configurable

This commit is contained in:
ThomasV
2023-06-19 14:46:56 +02:00
parent 606c51bc4e
commit 39f8664402
2 changed files with 13 additions and 11 deletions

View File

@@ -32,9 +32,6 @@ if TYPE_CHECKING:
from .simple_config import SimpleConfig
API_URL_MAINNET = 'https://swaps.electrum.org/api'
API_URL_TESTNET = 'https://swaps.electrum.org/testnet'
API_URL_REGTEST = 'https://localhost/api'
@@ -159,12 +156,7 @@ class SwapManager(Logger):
if swap.is_reverse and swap.prepay_hash is not None:
self.prepayments[swap.prepay_hash] = bytes.fromhex(k)
# api url
if constants.net == constants.BitcoinMainnet:
self.api_url = API_URL_MAINNET
elif constants.net == constants.BitcoinTestnet:
self.api_url = API_URL_TESTNET
else:
self.api_url = API_URL_REGTEST
self.api_url = wallet.config.get_swapserver_url()
# init default min & max
self.init_min_max_values()