ui: Enable Particl CT and RCT to XMR swaps.

2024-05-20_merge
tecnovert 3 years ago
parent 965db389f6
commit b8fd4ad85b
No known key found for this signature in database
GPG Key ID: 8ED6D8750C4E3F93
  1. 9
      basicswap/http_server.py
  2. 6
      basicswap/interface_part.py
  3. 5
      basicswap/interface_xmr.py

@ -66,8 +66,10 @@ def value_or_none(v):
def getCoinName(c): def getCoinName(c):
if c == Coins.PART_ANON or c == Coins.PART_BLIND: if c == Coins.PART_ANON:
return chainparams[Coins.PART]['name'].capitalize() + 'Anon' return chainparams[Coins.PART]['name'].capitalize() + 'Anon'
if c == Coins.PART_BLIND:
return chainparams[Coins.PART]['name'].capitalize() + 'Blind'
return chainparams[c]['name'].capitalize() return chainparams[c]['name'].capitalize()
@ -79,9 +81,8 @@ def listAvailableCoins(swap_client):
if v['connection_type'] == 'rpc': if v['connection_type'] == 'rpc':
coins.append((int(k), getCoinName(k))) coins.append((int(k), getCoinName(k)))
if k == Coins.PART: if k == Coins.PART:
pass coins.append((int(Coins.PART_ANON), getCoinName(Coins.PART_ANON)))
# TODO: Uncomment coins.append((int(Coins.PART_BLIND), getCoinName(Coins.PART_BLIND)))
# coins.append((int(Coins.PART_ANON), getCoinName(k)))
return coins return coins

@ -116,6 +116,9 @@ class PARTInterfaceBlind(PARTInterface):
def balance_type(): def balance_type():
return BalanceTypes.BLIND return BalanceTypes.BLIND
def coin_name(self):
return super().coin_name() + ' Blind'
def encodeSegwitP2WSH(self, p2wsh): def encodeSegwitP2WSH(self, p2wsh):
return segwit_addr.encode(self.chainparams_network()['hrp'], 0, p2wsh[2:]) return segwit_addr.encode(self.chainparams_network()['hrp'], 0, p2wsh[2:])
@ -608,6 +611,9 @@ class PARTInterfaceAnon(PARTInterface):
def balance_type(): def balance_type():
return BalanceTypes.ANON return BalanceTypes.ANON
def coin_name(self):
return super().coin_name() + ' Anon'
def publishBLockTx(self, Kbv, Kbs, output_amount, feerate): def publishBLockTx(self, Kbv, Kbs, output_amount, feerate):
sx_addr = self.formatStealthAddress(Kbv, Kbs) sx_addr = self.formatStealthAddress(Kbv, Kbs)
self._log.debug('sx_addr: {}'.format(sx_addr)) self._log.debug('sx_addr: {}'.format(sx_addr))

@ -120,8 +120,9 @@ class XMRInterface(CoinInterface):
# rv['blocks'] = self.rpc_cb('get_block_count')['count'] # rv['blocks'] = self.rpc_cb('get_block_count')['count']
rv['blocks'] = self.rpc_cb2('get_height', timeout=30)['height'] rv['blocks'] = self.rpc_cb2('get_height', timeout=30)['height']
sync_info = self.rpc_cb('sync_info', timeout=30) # sync_info = self.rpc_cb('sync_info', timeout=30)
rv['verificationprogress'] = 0.0 if 'spans' in sync_info else 1.0 # rv['verificationprogress'] = 0.0 if 'spans' in sync_info else 1.0
rv['verificationprogress'] = 0.0
return rv return rv

Loading…
Cancel
Save