Skip to content

Commit

Permalink
Fix tx typo. Add wallet balance on display.
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Aug 17, 2024
1 parent f5269bb commit 2a8f7c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -94,6 +96,4 @@ sent12v8ghhg98e2n0chyje3su4uqlsg75sh4lwcyww
zs1gn457262c52z5xa666k77zafqmke0hd60qvc38dk48w9fx378h4zjs5rrwnl0x8qazj4q3x4svz
```



![ARRR](./img/ARRR.png)
24 changes: 13 additions & 11 deletions SentinelMultiPay.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
NODEAPI = "/sentinel/nodes/%s"
GRPC = scrtxxs.GRPC
SSL = True
VERSION = 20240817.0234
VERSION = 20240817.1914
SATOSHI = 1000000

class MultiPay():
Expand Down Expand Up @@ -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
Expand All @@ -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']:
Expand All @@ -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
Expand Down Expand Up @@ -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",
)
Expand Down Expand Up @@ -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":
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions scrtxxs.py
Original file line number Diff line number Diff line change
@@ -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

'''
Expand Down

0 comments on commit 2a8f7c1

Please sign in to comment.