Skip to content

Commit 2a8f7c1

Browse files
committed
Fix tx typo. Add wallet balance on display.
1 parent f5269bb commit 2a8f7c1

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ This will run in a loop and prompt you for sentinel wallet addresses and amounts
88

99
* requires sentinel-sdk
1010

11+
* requires requests
12+
1113
* requires >= python 3.10
1214

1315
To install the dependency:
1416

1517
```shell
16-
pip install sentinel-sdk
18+
pip install sentinel-sdk requests
1719
```
1820

1921
Clone the repository
@@ -28,7 +30,7 @@ Within the repository directory, edit the **scrtxxs.py** to your specific parame
2830

2931
* WalletName - The name you will give your sending wallet in the krygin
3032

31-
* HotWalletPW - The Password for your wallet in the keyring
33+
* HotWalletPW - The Password for MultiPay Keyring
3234

3335
* WalletSeed - The seed phrase of the sending wallet if not already in the keyring. leave blank if you already imported this wallet once before
3436

@@ -94,6 +96,4 @@ sent12v8ghhg98e2n0chyje3su4uqlsg75sh4lwcyww
9496
zs1gn457262c52z5xa666k77zafqmke0hd60qvc38dk48w9fx378h4zjs5rrwnl0x8qazj4q3x4svz
9597
```
9698

97-
98-
9999
![ARRR](./img/ARRR.png)

SentinelMultiPay.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
NODEAPI = "/sentinel/nodes/%s"
2424
GRPC = scrtxxs.GRPC
2525
SSL = True
26-
VERSION = 20240817.0234
26+
VERSION = 20240817.1914
2727
SATOSHI = 1000000
2828

2929
class MultiPay():
@@ -66,7 +66,7 @@ def __keyring(self, keyring_passphrase: str):
6666
kr.keyring_key = keyring_passphrase
6767
return kr
6868

69-
def __get_balance(self, address):
69+
def get_balance(self, address):
7070
CoinDict = {'dvpn' : 0, 'scrt' : 0, 'dec' : 0, 'atom' : 0, 'osmo' : 0}
7171
#CoinDict = {'tsent' : 0, 'scrt' : 0, 'dec' : 0, 'atom' : 0, 'osmo' : 0}
7272
endpoint = "/bank/balances/" + address
@@ -76,7 +76,7 @@ def __get_balance(self, address):
7676
except:
7777
return None
7878

79-
print(coinJSON)
79+
#print(coinJSON)
8080
try:
8181
for coin in coinJSON['result']:
8282
if "udvpn" in coin['denom']:
@@ -86,10 +86,7 @@ def __get_balance(self, address):
8686
return None
8787
return CoinDict
8888

89-
def SendDVPNs(self, addr_amts):
90-
balance = self.__get_balance(self.sdk._account.address)
91-
wallet_balance = int(balance.get("dvpn", 0))
92-
89+
def SendDVPNs(self, addr_amts, wallet_balance: int):
9390
amt = 0
9491

9592
# Sum total amount
@@ -120,7 +117,7 @@ def SendDVPNs(self, addr_amts):
120117
tx.add_msg(
121118
tx_type='transfer',
122119
sender=self.sdk._account,
123-
receipient=addr,
120+
recipient=addr,
124121
amount=udvpn,
125122
denom="udvpn",
126123
)
@@ -154,12 +151,17 @@ def SendDVPNs(self, addr_amts):
154151

155152

156153
if __name__ == "__main__":
154+
print(f"Leeloo Dallas Multipay - A DVPN multipay transactor - by freQniK - version: 5th Element {VERSION}\n\n")
155+
print("You will be presented with a loop to enter Sentinel wallet addresses and amt. When finished, enter 'done'")
157156
mp = MultiPay(scrtxxs.HotWalletPW, scrtxxs.WalletName, scrtxxs.WalletSeed)
158157

158+
balance = mp.get_balance(mp.sdk._account.address)
159+
wallet_balance = float(int(balance.get("dvpn", 0)) / SATOSHI)
160+
161+
print(f"Balance: {wallet_balance} dvpn")
162+
159163
SendDict = {}
160164

161-
print(f"Leeloo Dallas Multipay - A DVPN multipay transactor - by freQniK - version: 5th Element {VERSION}\n\n")
162-
print("You will be presented with a loop to enter Sentinel wallet addresses and amt. When finished, enter 'done'")
163165
while True:
164166
addr = input("Enter wallet address: ")
165167
if addr.upper() == "DONE":
@@ -172,7 +174,7 @@ def SendDVPNs(self, addr_amts):
172174
print(SendDict)
173175
answer = input("Would you iike to continue (Y/n): ")
174176
if answer.upper() == "Y":
175-
if mp.SendDVPNs(SendDict):
177+
if mp.SendDVPNs(SendDict, int(wallet_balance * SATOSHI)):
176178
print("Transaction completed successfully. Please check the log file")
177179
print(f"{scrtxxs.KeyringDIR}/multipay.log")
178180
else:

scrtxxs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
'''
1+
\'''
22
You need to edit the following variables below with your desired values:
33

44
WalletName - Whatever you want to name the wallet in the keyring
5-
HotWalletPW - Passowrd for your wallet in the keyring
5+
HotWalletPW - Passowrd for your keyring
66
WalletSeed - Seed if it is a new wallet, o/w it will pull from the keyring the WalletName
77

88
'''

0 commit comments

Comments
 (0)