diff --git a/.DS_Store b/.DS_Store index ace519f8..16b6c3ca 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store index 986d0ffb..11cedbdc 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/cli/sentinel.py b/src/cli/sentinel.py index f3a05817..1da46cf0 100644 --- a/src/cli/sentinel.py +++ b/src/cli/sentinel.py @@ -214,6 +214,7 @@ def get_subscriptions(self, ADDRESS): SubsResult[k].append(v.lstrip().rstrip()) k=0 + print(SubsResult) for snaddress in SubsResult[NodeKeys.SubsInfoKeys[4]]: try: NodeData = self.NodeTree.get_node(snaddress).data diff --git a/src/cli/wallet.py b/src/cli/wallet.py index 9babff9e..080255da 100644 --- a/src/cli/wallet.py +++ b/src/cli/wallet.py @@ -396,7 +396,8 @@ def get_balance(self, address): http = Request.hadapter() endpoint = HTTParams.BALANCES_ENDPOINT + address CoinDict = {'dvpn' : 0, 'scrt' : 0, 'dec' : 0, 'atom' : 0, 'osmo' : 0} - + #CoinDict = {'tsent' : 0, 'scrt' : 0, 'dec' : 0, 'atom' : 0, 'osmo' : 0} + try: r = http.get(HTTParams.APIURL + endpoint) coinJSON = r.json() @@ -407,7 +408,9 @@ def get_balance(self, address): try: for coin in coinJSON['result']: if "udvpn" in coin['denom']: + #if "tsent" in coin['denom']: CoinDict['dvpn'] = round(float(float(coin['amount']) /IBCTokens.SATOSHI),4) + #CoinDict['tsent'] = round(float(float(coin['amount']) /IBCTokens.SATOSHI),4) elif IBCTokens.IBCSCRT in coin['denom']: CoinDict['scrt'] = round(float(float(coin['amount']) /IBCTokens.SATOSHI),4) elif IBCTokens.IBCDEC in coin['denom']: diff --git a/src/fiat/fiat_interface.py b/src/fiat/fiat_interface.py index d2cb50bb..22781b09 100755 --- a/src/fiat/fiat_interface.py +++ b/src/fiat/fiat_interface.py @@ -20,6 +20,7 @@ from os import path import requests from requests.auth import HTTPBasicAuth +import asyncio import stripe from stripe.error import CardError @@ -62,10 +63,10 @@ class FiatInterface(Screen): def __init__(self, **kwargs): super(FiatInterface, self).__init__() - CoinOptions = self.DynamicCoinOptions() - self.DVPNOptions = CoinOptions['dvpn'] - self.DECOptions = CoinOptions['dec'] - self.SCRTOptions = CoinOptions['scrt'] + self.CoinOptions = self.DynamicCoinOptions() + self.DVPNOptions = self.CoinOptions['dvpn'] + self.DECOptions = self.CoinOptions['dec'] + self.SCRTOptions = self.CoinOptions['scrt'] self.set_token_qty(str(self.DVPNOptions[0])) @@ -187,7 +188,7 @@ def DynamicCoinOptions(self): pass for c in coins: - response = api.get_usd(c) + response = asyncio.run(api.get_usd(c)) qty = int(MAX_SPEND/float(response['price'])) @@ -243,7 +244,7 @@ def get_token_price(self, token): api = GetPriceAPI() try: - response = api.get_usd(token) + response = asyncio.run(api.get_usd(token)) if response['success']: token_price = response['price'] else: diff --git a/src/typedef/konstants.py b/src/typedef/konstants.py index b929113c..b840da27 100755 --- a/src/typedef/konstants.py +++ b/src/typedef/konstants.py @@ -11,7 +11,9 @@ class ConfParams(): CONNECTIONINFO = path.join(KEYRINGDIR, "connection.infos") WIREGUARD_STATUS = path.join(BASEDIR, "status.json") CHAINID = 'sentinelhub-2' + #CHAINID = 'testnet' GASPRICE = "0.2udvpn" + #GASPRICE = "0.2tsent" GASADJUSTMENT = 1.15 GAS = 500000 @@ -19,13 +21,16 @@ class ConfParams(): class HTTParams(): # Note http://128.199.90.172:26657 is testnet ONLY! TIMEOUT = 5 - APIURL = "https://api.sentinel.mathnodes.com" + #APIURL = "https://api.sentinel.mathnodes.com" + APIURL = "http://128.199.90.172:1317" SERVER_URL = "https://aimokoivunen.mathnodes.com:5000" - RPC = "https://rpc.mathnodes.com:443" + #RPC = "https://rpc.mathnodes.com:443" + RPC = 'http://128.199.90.172:26657' RPCS = ['https://rpc.mathnodes.com:443', 'https://rpc.sentinel.co:443', 'https://sentinel-rpc.badgerbite.io:443', 'https://sentinel-rpc2.badgerbite.io:443', 'https://rpc.sentinel.quokkastake.io:443', 'https://rpc-sentinel.whispernode.com:443', - 'https://rpc-sentinel-ia.cosmosia.notional.ventures:443'] - GRPC = "grpc+http://aimokoivunen.mathnodes.com:9090/" + 'https://rpc-sentinel-ia.cosmosia.notional.ventures:443','http://128.199.90.172:26657'] + #GRPC = "grpc+http://aimokoivunen.mathnodes.com:9090/" + GRPC = "grpc+http://128.199.90.172:9090/" NODE_SCORE_ENDPOINT = "/api/nodescores" NODE_LOCATION_ENDPOINT = "/api/nodelocations" NODE_TYPE_ENDPOINT = "/api/nodetypes" @@ -48,8 +53,8 @@ class IBCTokens(): IBCCOINS = [{'uscrt' : IBCSCRT}, {'uatom' : IBCATOM}, {'udec' : IBCDEC}, {'uosmo' : IBCOSMO}, {'uknwn' :IBCUNKWN}] UNITTOKEN = {'uscrt' : 'scrt', 'uatom' : 'atom' , 'uosmo' : 'osmo', 'udec' : 'dec', 'udvpn' : 'dvpn', 'tsent' : 'tsent'} - mu_coins = ["tsent", "udvpn", "uscrt", "uosmo", "uatom", "udec"] - #mu_coins = ["tsent", "udvpn", "uscrt", "uosmo", "uatom", "udec"] + #mu_coins = ["tsent", "udvpn", "uscrt", "uosmo", "uatom", "udec"] + mu_coins = ["udvpn", "uscrt", "uosmo", "uatom", "udec"] diff --git a/src/ui/screens.py b/src/ui/screens.py index ed09e0fd..da83f7d1 100644 --- a/src/ui/screens.py +++ b/src/ui/screens.py @@ -927,19 +927,22 @@ def get_qr_code_address(self): return path.join(CONFIG.IMGDIR, "dvpn.png") + # testnet params def SetBalances(self, CoinDict): if CoinDict: - self.dec_text = str(CoinDict['dec']) + " dec" + self.dec_text = str(CoinDict['dec']) + " dec" self.scrt_text = str(CoinDict['scrt']) + " scrt" self.atom_text = str(CoinDict['atom']) + " atom" self.osmo_text = str(CoinDict['osmo']) + " osmo" self.dvpn_text = str(CoinDict['dvpn']) + " dvpn" + #self.dvpn_text = str(CoinDict['tsent']) + " tsent" else: - self.dec_text = str("0.0") + " dec" + self.dec_text = str("0.0") + " dec" self.scrt_text = str("0.0") + " scrt" self.atom_text = str("0.0") + " atom" self.osmo_text = str("0.0") + " osmo" self.dvpn_text = str("0.0") + " dvpn" + #self.dvpn_text = str("0.0") + " tsent" self.dialog = MDDialog( text="Error Loading Wallet Balance. Please try again later.", md_bg_color=get_color_from_hex(MeileColors.DIALOG_BG_COLOR), diff --git a/src/ui/widgets.py b/src/ui/widgets.py index 67c5f99f..542e434f 100644 --- a/src/ui/widgets.py +++ b/src/ui/widgets.py @@ -185,9 +185,8 @@ def get_usd(self): CoinPriceAPI = GetPriceAPI() PriceDict = asyncio.run(CoinPriceAPI.get_usd(coin)) self.coin_price = PriceDict['price'] - - - self.ids.usd_price.text = '$' + str(format(floatprice, '.3f')) + + self.ids.usd_price.text = '$' + str(round(float(self.coin_price) * float(amt),3)) return PriceDict['success']