1616import bech32
1717from mospy import Transaction
1818from grpc import RpcError
19+ from Crypto .Hash import RIPEMD160
1920
2021from datetime import datetime
2122
2223MNAPI = "https://api.sentinel.mathnodes.com"
2324NODEAPI = "/sentinel/nodes/%s"
2425GRPC = scrtxxs .GRPC
2526SSL = True
26- VERSION = 20240817.1914
27+ VERSION = 20240818.0304
2728SATOSHI = 1000000
2829
2930class MultiPay ():
@@ -36,7 +37,7 @@ def __init__(self, keyring_passphrase, wallet_name, seed_phrase = None):
3637 privkey_obj = ecdsa .SigningKey .from_string (bip44_def_ctx .PrivateKey ().Raw ().ToBytes (), curve = ecdsa .SECP256k1 )
3738 pubkey = privkey_obj .get_verifying_key ()
3839 s = hashlib .new ("sha256" , pubkey .to_string ("compressed" )).digest ()
39- r = hashlib . new ( " ripemd160" , s ). digest ( )
40+ r = self . ripemd160 ( s )
4041 five_bit_r = bech32 .convertbits (r , 8 , 5 )
4142 account_address = bech32 .bech32_encode ("sent" , five_bit_r )
4243 print (account_address )
@@ -55,6 +56,18 @@ def __init__(self, keyring_passphrase, wallet_name, seed_phrase = None):
5556
5657 now = datetime .now ()
5758 self .logfile .write (f"\n ---------------------------{ now } ---------------------------\n " )
59+
60+ def ripemd160 (self , contents : bytes ) -> bytes :
61+ """
62+ Get ripemd160 hash using PyCryptodome.
63+
64+ :param contents: bytes contents.
65+
66+ :return: bytes ripemd160 hash.
67+ """
68+ h = RIPEMD160 .new ()
69+ h .update (contents )
70+ return h .digest ()
5871
5972 def __keyring (self , keyring_passphrase : str ):
6073 if not path .isdir (scrtxxs .KeyringDIR ):
@@ -172,7 +185,7 @@ def SendDVPNs(self, addr_amts, wallet_balance: int):
172185
173186 print ("The following addresses will receive these repsective amounts: " )
174187 print (SendDict )
175- answer = input ("Would you iike to continue (Y/n): " )
188+ answer = input ("Would you like to continue (Y/n): " )
176189 if answer .upper () == "Y" :
177190 if mp .SendDVPNs (SendDict , int (wallet_balance * SATOSHI )):
178191 print ("Transaction completed successfully. Please check the log file" )
0 commit comments