-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (29 loc) · 1.17 KB
/
main.py
File metadata and controls
35 lines (29 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from tronpy import Tron
from tronpy.keys import PrivateKey
from tronpy.providers import HTTPProvider
from mnemonic import Mnemonic
import hashlib
import bip32utils
api_key=""
mnemonic_phrase = "" #mnemonic_phrase of wallet A that has rights of wallet B
client = Tron(HTTPProvider(api_key=api_key))
mnemo = Mnemonic("english")
seed = mnemo.to_seed(mnemonic_phrase)
master_key = bip32utils.BIP32Key.fromEntropy(seed)
child_key = master_key.ChildKey(44 + bip32utils.BIP32_HARDEN) \
.ChildKey(195 + bip32utils.BIP32_HARDEN) \
.ChildKey(0 + bip32utils.BIP32_HARDEN) \
.ChildKey(0) \
.ChildKey(0)
priv_key = PrivateKey(child_key.PrivateKey())
address = input("Your address of wallet with MultiSign: ") #Wallet's address B that has multisign (and doesn't have rights for example)
receiver_addr = input("Address of wallet to get tron: ")
def send_trx(amount, toadress):
txn = (
client.trx.transfer(address, toadress, int(int(amount-2) * 1e6))
.build()
.sign(priv_key)
)
result = txn.broadcast()
print("Transaction ID:", txn.txid)
send_trx(1,receiver_addr) #Example