Questions tagged [tronpy]

Python TRON HTTP API client

tronpy is a python HTTP API client for TRON

Installation:

pip install tronpy

Official documentation

Project page on pypi

6 questions
2
votes
1 answer

How to transfer TRC20 token using tronpy?

I want to send USDT TRC20 tokens using tronpy, while i succeded to transfer TRX, same approach failed for the TRC20 tokens, here's my code: import codecs from tronpy.keys import PrivateKey from hexbytes import HexBytes def transfer(self,…
zfou
  • 891
  • 1
  • 10
  • 33
1
vote
0 answers

Python tronpy -- account not found on-chain (get_account_balance())

have a exceptions when try to get a acount balance use a tronpy exception: tronpy.exceptions.AddressNotFound: account not found on-chain have this problem with a new wallet and with a just adress from tronscan code to create account tron =…
1
vote
0 answers

Trigger a function on tron blockchain

I'm trying to trigger buyEnergy on this contract TEeLFcbSc2LFSFrTZnWRCacZzo3ZtBybh2 buyEnergy function accept 5 parameters buyEnergy(address _receiver, uint8 _energyRentalUnit, uint256 _energyAmount, uint256 affiliate, uint256 _rentalPeriod) I have…
1
vote
0 answers

Sending TRX with tronpy

I'm using tronpy library to send trx, here is my code: from tronpy import Tron from tronpy.keys import PrivateKey # integers representing half & one Tron HALF_TRON = 500000 ONE_TRON = 1000000 #equals 1 TRX # your wallet information WALLET_ADDRESS…
Goorhatar
  • 19
  • 2
0
votes
0 answers

How to send USDT TRC20 via Python

How can I send USDT TRC20 via Python? I used this code: from tronpy import Tron from tronpy.keys import PrivateKey client = Tron(network='mainnet') priv_key = PrivateKey(bytes.fromhex("0")) txn = ( client.trx.transfer(from_="0", to="0",…
idks
  • 1
0
votes
0 answers

How to create a smart contract for transactions with tronpy

When I use python, I want to perform a token-swapping function like sunswap. I implemented the trc20 token exchange function with tronpy, but I couldn't find a trx to usdt exchange import time from decimal import Decimal from typing import List from…