mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-06 02:38:11 +01:00
ui: rateslist returns js list of rates.
This commit is contained in:
@@ -17,6 +17,7 @@ from .basicswap_util import (
|
||||
from .chainparams import (
|
||||
Coins,
|
||||
chainparams,
|
||||
getCoinIdFromTicker,
|
||||
)
|
||||
from .ui.util import (
|
||||
PAGE_LIMIT,
|
||||
@@ -339,6 +340,15 @@ def js_rates(self, url_split, post_string, is_json):
|
||||
return bytes(json.dumps(sc.lookupRates(coin_from, coin_to)), 'UTF-8')
|
||||
|
||||
|
||||
def js_rates_list(self, url_split, query_string, is_json):
|
||||
get_data = urllib.parse.parse_qs(query_string)
|
||||
|
||||
sc = self.server.swap_client
|
||||
coin_from = getCoinIdFromTicker(get_data['from'][0])
|
||||
coin_to = getCoinIdFromTicker(get_data['to'][0])
|
||||
return bytes(json.dumps(sc.lookupRates(coin_from, coin_to, True)), 'UTF-8')
|
||||
|
||||
|
||||
def js_rate(self, url_split, post_string, is_json):
|
||||
if post_string == '':
|
||||
raise ValueError('No post data')
|
||||
|
||||
Reference in New Issue
Block a user