mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-03 09:19:26 +00:00
ui: Enable Particl CT and RCT to XMR swaps.
This commit is contained in:
parent
965db389f6
commit
b8fd4ad85b
3 changed files with 14 additions and 6 deletions
|
@ -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…
Reference in a new issue