Closed 0xJayShen closed 5 years ago
I do not observe problems, all actions are performed.
@serderovsh can you show me code?include address and private_key(test_net)
from tronapi import Tron
full_node = 'https://api.shasta.trongrid.io'
solidity_node = 'https://api.shasta.trongrid.io'
event_server = 'https://api.shasta.trongrid.io'
tron = Tron(full_node=full_node,
solidity_node=solidity_node,
event_server=event_server)
tron.private_key = 'da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0'
tron.default_address = tron.address.from_private_key(tron.private_key).base58
print(tron.trx.send('TGEJj8eus46QMHPgWQe1FJ2ymBXRm96fn1', 0.001))
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18)
Your implementation is also correct!
@serderovsh your code is right,mine is wrong,But I don't know why
tron = Tron(full_node=full_node,
solidity_node=solidity_node,
event_server=event_server)
balance = tron.trx.get_balance(address="418f48df84f242a7828ccb07e1ad6d087490277c9b")
# result = tron.trx.get_transaction('TxId')
tron.private_key = '3a1d6b03cd151bfbaa360fdaedb9943d275a7a0a86e3f1ebdee77e715485f8a7'
tron.default_address = 'TP2pvob6fEyfycEQydmjwc8L1VwLS7izV6'
# added message
send = tron.trx.send_transaction('41a858daf83d105dd94c6e9cca1b50894c9c773b17', 1000.0)
Check out
It makes no sense to specify the format of the address "41", use the standard formats "T". If necessary, the plugin itself converts it into the required format.
@serderovsh what is default_address,That's why I was wrong
418f48df84f242a7828ccb07e1ad6d087490277c9b -> HEX TP2pvob6fEyfycEQydmjwc8L1VwLS7izV6 -> Base58
# It was
tron.default_address = '418f48df84f242a7828ccb07e1ad6d087490277c9b'
# changed to
tron.default_address = 'TP2pvob6fEyfycEQydmjwc8L1VwLS7izV6'
@serderovsh thanks !It helps.
This defect will be fixed soon. And then there will be no problems with address formats.
@serderovsh Thank you for doing that
code
then
what should i do,I tried a lot about methods of str and bytes