Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'dict' object has no attribute 'text' #86

Open
aditya-dev201 opened this issue Feb 22, 2021 · 0 comments
Open

AttributeError: 'dict' object has no attribute 'text' #86

aditya-dev201 opened this issue Feb 22, 2021 · 0 comments

Comments

@aditya-dev201
Copy link

i am using below code to send trc20 token but it give error : AttributeError: 'dict' object has no attribute 'text'

import tronapi
from tronapi import Tron

full_node = 'https://api.trongrid.io'
solidity_node = 'https://api.trongrid.io'
event_server = 'https://api.trongrid.io'

PK = "private key"
PA = "target address"

add = "TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7" #wink contract address

am = 10
td = 6

tron = Tron(full_node=full_node,
solidity_node=solidity_node,
event_server=event_server)

def setTronPK(pk):
tron.private_key = pk
tron.default_address = tron.address.from_private_key(pk).base58

setTronPK(PK)

txn = tron.transaction_builder.trigger_smart_contract(
contract_address=tron.address.to_hex(add),
function_selector='transfer(address,uint256)',
fee_limit=10000000,
call_value=0,
parameters=[
{'type': 'address', 'value': tron.address.to_hex(PA)},
{'type': 'int256', 'value': am*td}
]
)
print(txn.text)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant