diff --git a/src/cli/wallet.py b/src/cli/wallet.py index ea9b2a2d..a1e58f85 100755 --- a/src/cli/wallet.py +++ b/src/cli/wallet.py @@ -321,25 +321,27 @@ def send_2plan_wallet(self, KEYNAME, plan_id, DENOM, amount_required, tax: bool= balance = self.get_balance(sdk._account.address) print(balance) - amount_required = float(amount_required) # Just in case was passed as str - token_ibc = {v: k for k, v in IBCTokens.IBCUNITTOKEN.items()} - ubalance = balance.get(token_ibc[DENOM][1:], 0) * IBCTokens.SATOSHI - # Get balance automatically return udvpn ad dvpn - if ubalance < amount_required: - message = f"Balance is too low, required: {amount_required}{DENOM}" - return (False, {'hash' : None, 'success' : False, 'message' : message}) + amount_required = int(amount_required) # Just in case was passed as str # F***ck we have always a unit issue ... if DENOM == "dvpn": print(f"Denom is a dvpn, convert as udvpn, amount_required: {amount_required}dvpn") DENOM = "udvpn" - amount_required = int(round(amount_required * IBCTokens.SATOSHI, 4)) - print(f"amount_required: {amount_required}udvpn") + ubalance = balance.get("dvpn", 0) * IBCTokens.SATOSHI else: # I need to convert osmo, atom etc to ibc denom # token_ibc (k: v) is a dict like: {'uscrt': 'ibc/31FEE1A2A9F9C01113F90BD0BBCCE8FD6BBB8585FAF109A2101827DD1D5B95B8', 'uatom': 'ibc/A8C2D23A1E6 token_ibc = {k: v for k, v in IBCTokens.IBCUNITTOKEN.items()} DENOM = token_ibc.get(DENOM, DENOM) + ubalance = balance.get(token_ibc[DENOM][1:], 0) * IBCTokens.SATOSHI + + print(ubalance) + print(f"amount_required: {amount_required}{DENOM}") + + # Get balance automatically return udvpn ad dvpn + if ubalance < amount_required: + message = f"Balance is too low, required: {amount_required}{DENOM}" + return (False, {'hash' : None, 'success' : False, 'message' : message}) gas = random.randint(ConfParams.GAS-50000, 314159) diff --git a/src/typedef/konstants.py b/src/typedef/konstants.py index b0d40a0c..0b1b0dcd 100755 --- a/src/typedef/konstants.py +++ b/src/typedef/konstants.py @@ -558,8 +558,8 @@ class IBCTokens(): #mu_coins = ["tsent", "udvpn", "uscrt", "uosmo", "uatom", "udec"] class TextStrings(): dash = "-" - VERSION = "v2.0.4" - BUILD = "1733738460383" + VERSION = "v2.0.7" + BUILD = "1734702982077" RootTag = "SENTINEL" PassedHealthCheck = "Passed Sentinel Health Check" FailedHealthCheck = "Failed Sentinel Health Check" @@ -722,6 +722,22 @@ class NodeKeys(): + + + + + + + + + + + + + + + + diff --git a/src/ui/widgets.py b/src/ui/widgets.py index df9e08f3..518a89f5 100755 --- a/src/ui/widgets.py +++ b/src/ui/widgets.py @@ -1036,7 +1036,7 @@ def pay_meile_plan_with_wallet(self, deposit, mu_coin, usd, on_success: callable KEYNAME = CONFIG['wallet'].get('keyname', '') hwf = HandleWalletFunctions() - result, output = hwf.send_2plan_wallet(KEYNAME, self.plan_id, mu_coin, deposit) + result, output = hwf.send_2plan_wallet(KEYNAME, self.plan_id, mu_coin, int(round(float(deposit),4)*IBCTokens.SATOSHI)) print("result", result) print("output", output) @@ -1061,7 +1061,7 @@ def pay_meile_plan_with_wallet(self, deposit, mu_coin, usd, on_success: callable MDFlatButton( text="OK", theme_text_color="Custom", - text_color=self.theme_cls.primary_color, + text_color=MeileColors.MEILE, on_release=self.closeDialog ),]) if isinstance(output, dict) is True: