Skip to content

Commit

Permalink
Final build for Sentinel upgrade. v1.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Aug 12, 2023
1 parent c193169 commit d27f8cb
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 18 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified src/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions src/cli/sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/cli/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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']:
Expand Down
13 changes: 7 additions & 6 deletions src/fiat/fiat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from os import path
import requests
from requests.auth import HTTPBasicAuth
import asyncio

import stripe
from stripe.error import CardError
Expand Down Expand Up @@ -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]))


Expand Down Expand Up @@ -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']))

Expand Down Expand Up @@ -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:
Expand Down
17 changes: 11 additions & 6 deletions src/typedef/konstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,26 @@ 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


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"
Expand All @@ -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"]



Expand Down
7 changes: 5 additions & 2 deletions src/ui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 2 additions & 3 deletions src/ui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down

0 comments on commit d27f8cb

Please sign in to comment.