diff --git a/README.md b/README.md index b63142c..b384f99 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,14 @@ This will run in a loop and prompt you for sentinel wallet addresses and amounts * requires sentinel-sdk +* requires requests + * requires >= python 3.10 To install the dependency: ```shell -pip install sentinel-sdk +pip install sentinel-sdk requests ``` Clone the repository @@ -28,7 +30,7 @@ Within the repository directory, edit the **scrtxxs.py** to your specific parame * WalletName - The name you will give your sending wallet in the krygin -* HotWalletPW - The Password for your wallet in the keyring +* HotWalletPW - The Password for MultiPay Keyring * WalletSeed - The seed phrase of the sending wallet if not already in the keyring. leave blank if you already imported this wallet once before @@ -94,6 +96,4 @@ sent12v8ghhg98e2n0chyje3su4uqlsg75sh4lwcyww zs1gn457262c52z5xa666k77zafqmke0hd60qvc38dk48w9fx378h4zjs5rrwnl0x8qazj4q3x4svz ``` - - ![ARRR](./img/ARRR.png) diff --git a/SentinelMultiPay.py b/SentinelMultiPay.py index 73a3b05..246dc79 100644 --- a/SentinelMultiPay.py +++ b/SentinelMultiPay.py @@ -23,7 +23,7 @@ NODEAPI = "/sentinel/nodes/%s" GRPC = scrtxxs.GRPC SSL = True -VERSION = 20240817.0234 +VERSION = 20240817.1914 SATOSHI = 1000000 class MultiPay(): @@ -66,7 +66,7 @@ def __keyring(self, keyring_passphrase: str): kr.keyring_key = keyring_passphrase return kr - def __get_balance(self, address): + def get_balance(self, address): CoinDict = {'dvpn' : 0, 'scrt' : 0, 'dec' : 0, 'atom' : 0, 'osmo' : 0} #CoinDict = {'tsent' : 0, 'scrt' : 0, 'dec' : 0, 'atom' : 0, 'osmo' : 0} endpoint = "/bank/balances/" + address @@ -76,7 +76,7 @@ def __get_balance(self, address): except: return None - print(coinJSON) + #print(coinJSON) try: for coin in coinJSON['result']: if "udvpn" in coin['denom']: @@ -86,10 +86,7 @@ def __get_balance(self, address): return None return CoinDict - def SendDVPNs(self, addr_amts): - balance = self.__get_balance(self.sdk._account.address) - wallet_balance = int(balance.get("dvpn", 0)) - + def SendDVPNs(self, addr_amts, wallet_balance: int): amt = 0 # Sum total amount @@ -120,7 +117,7 @@ def SendDVPNs(self, addr_amts): tx.add_msg( tx_type='transfer', sender=self.sdk._account, - receipient=addr, + recipient=addr, amount=udvpn, denom="udvpn", ) @@ -154,12 +151,17 @@ def SendDVPNs(self, addr_amts): if __name__ == "__main__": + print(f"Leeloo Dallas Multipay - A DVPN multipay transactor - by freQniK - version: 5th Element {VERSION}\n\n") + print("You will be presented with a loop to enter Sentinel wallet addresses and amt. When finished, enter 'done'") mp = MultiPay(scrtxxs.HotWalletPW, scrtxxs.WalletName, scrtxxs.WalletSeed) + balance = mp.get_balance(mp.sdk._account.address) + wallet_balance = float(int(balance.get("dvpn", 0)) / SATOSHI) + + print(f"Balance: {wallet_balance} dvpn") + SendDict = {} - print(f"Leeloo Dallas Multipay - A DVPN multipay transactor - by freQniK - version: 5th Element {VERSION}\n\n") - print("You will be presented with a loop to enter Sentinel wallet addresses and amt. When finished, enter 'done'") while True: addr = input("Enter wallet address: ") if addr.upper() == "DONE": @@ -172,7 +174,7 @@ def SendDVPNs(self, addr_amts): print(SendDict) answer = input("Would you iike to continue (Y/n): ") if answer.upper() == "Y": - if mp.SendDVPNs(SendDict): + if mp.SendDVPNs(SendDict, int(wallet_balance * SATOSHI)): print("Transaction completed successfully. Please check the log file") print(f"{scrtxxs.KeyringDIR}/multipay.log") else: diff --git a/scrtxxs.py b/scrtxxs.py index ba9beac..ee4556e 100644 --- a/scrtxxs.py +++ b/scrtxxs.py @@ -1,8 +1,8 @@ -''' +\''' You need to edit the following variables below with your desired values: WalletName - Whatever you want to name the wallet in the keyring -HotWalletPW - Passowrd for your wallet in the keyring +HotWalletPW - Passowrd for your keyring WalletSeed - Seed if it is a new wallet, o/w it will pull from the keyring the WalletName '''