16
16
import bech32
17
17
from mospy import Transaction
18
18
from grpc import RpcError
19
+ from Crypto .Hash import RIPEMD160
19
20
20
21
from datetime import datetime
21
22
22
23
MNAPI = "https://api.sentinel.mathnodes.com"
23
24
NODEAPI = "/sentinel/nodes/%s"
24
25
GRPC = scrtxxs .GRPC
25
26
SSL = True
26
- VERSION = 20240817.1914
27
+ VERSION = 20240818.0304
27
28
SATOSHI = 1000000
28
29
29
30
class MultiPay ():
@@ -36,7 +37,7 @@ def __init__(self, keyring_passphrase, wallet_name, seed_phrase = None):
36
37
privkey_obj = ecdsa .SigningKey .from_string (bip44_def_ctx .PrivateKey ().Raw ().ToBytes (), curve = ecdsa .SECP256k1 )
37
38
pubkey = privkey_obj .get_verifying_key ()
38
39
s = hashlib .new ("sha256" , pubkey .to_string ("compressed" )).digest ()
39
- r = hashlib . new ( " ripemd160" , s ). digest ( )
40
+ r = self . ripemd160 ( s )
40
41
five_bit_r = bech32 .convertbits (r , 8 , 5 )
41
42
account_address = bech32 .bech32_encode ("sent" , five_bit_r )
42
43
print (account_address )
@@ -55,6 +56,18 @@ def __init__(self, keyring_passphrase, wallet_name, seed_phrase = None):
55
56
56
57
now = datetime .now ()
57
58
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 ()
58
71
59
72
def __keyring (self , keyring_passphrase : str ):
60
73
if not path .isdir (scrtxxs .KeyringDIR ):
@@ -172,7 +185,7 @@ def SendDVPNs(self, addr_amts, wallet_balance: int):
172
185
173
186
print ("The following addresses will receive these repsective amounts: " )
174
187
print (SendDict )
175
- answer = input ("Would you iike to continue (Y/n): " )
188
+ answer = input ("Would you like to continue (Y/n): " )
176
189
if answer .upper () == "Y" :
177
190
if mp .SendDVPNs (SendDict , int (wallet_balance * SATOSHI )):
178
191
print ("Transaction completed successfully. Please check the log file" )
0 commit comments