Skip to main content

A Python API for interacting with Tron networks

Project description

A Python API for interacting with the Tron (TRX)

https://img.shields.io/pypi/v/tronpytool.svg https://img.shields.io/pypi/pyversions/tronpytool.svg https://api.travis-ci.com/iexbase/tron-api-python.svg?branch=master https://img.shields.io/github/issues/iexbase/tron-api-python.svg https://img.shields.io/github/issues-pr/iexbase/tron-api-python.svg

A Command-Line Interface framework

You can install it in a system-wide location via pip:

sudo pip3 install tronpytool

Or install it locally using virtualenv:

virtualenv -p /usr/bin/python3 ~/tronpytool
source ~/tronpytool/bin/activate
pip3 install tronpytool

Usage

Specify the API endpoints:

Smart Contract

from tronpytool import HttpProvider
from tronpytool import Tron

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

# option 1
tron = Tron(full_node=full_node,
            solidity_node=solidity_node,
            event_server=event_server)

# option 2
tron_v2 = Tron()

# option 3
tron_v3 = Tron(
    default_address='TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY',
    private_key='...'
)

# option 4
tron_v4 = Tron().setNetwork('nile')

Code compile

Integration of forge that can work perfectly with latest version with ONE LINE code.

# !/usr/bin/env python
# coding: utf-8
import os

from tronpytool import TronBrew, Evm

solidity_files = [
    "vault/token/RaceToken.sol",
]

ROOT = '.../Documents/b95/devtron'
FACTORY = '$HOME/Documents/piplines/factoryabi'

print("-----> job from here")
print(ROOT)
print("-----> now its ready to go")

TronBrew(ROOT, FACTORY).setClassSolNames(solidity_files).setEvm(Evm.ISTANBUL).useForge().localTranspile()

Documentation

Read the library manual by the manual Documentation is available at docs.

Donations

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tronpytool-3.6.80.tar.gz (421.4 kB view details)

Uploaded Source

Built Distribution

tronpytool-3.6.80-py3-none-any.whl (99.4 kB view details)

Uploaded Python 3

File details

Details for the file tronpytool-3.6.80.tar.gz.

File metadata

  • Download URL: tronpytool-3.6.80.tar.gz
  • Upload date:
  • Size: 421.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for tronpytool-3.6.80.tar.gz
Algorithm Hash digest
SHA256 1fae157f7546e8992265bcdb692d7c7879070ae0bb197967ec3cac9a92049a11
MD5 d0e34b635327512653573fe31d15ba4d
BLAKE2b-256 74834f1656cbad153c9505485f952b062021f106dba2314049c5528d847cd47e

See more details on using hashes here.

File details

Details for the file tronpytool-3.6.80-py3-none-any.whl.

File metadata

  • Download URL: tronpytool-3.6.80-py3-none-any.whl
  • Upload date:
  • Size: 99.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for tronpytool-3.6.80-py3-none-any.whl
Algorithm Hash digest
SHA256 43aa710b82acdc5f0bab6508ed4a225f1e3df339b980df8043ec369f953f511d
MD5 5be014145a3beb5c121064dc24a5c2ce
BLAKE2b-256 93d4abae7fc28317a439914d4e2150da31fcc4efeaabb4bbeeb65b4fceee48e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page