Skip to main content

trontxsize - Calculate tron transaction size in bytes

CI Codecov PyPI version

In Tron (TRX) network, fee calculation algorithm is complex. And the most complex part of it is that it depends on transaction size.

But there's no method existing to calculate it

This library does just this:

import trontxsize

tx = ...  # transaction as returned by a TRON node, e.g. tronpy's Tron().get_transaction(tx_hash)
data = {"raw_data": tx["raw_data"], "signature": tx["signature"]}
print(trontxsize.get_tx_size(data))  # matches bandwidth you see in block explorer

How does it work? The library pre-compiled a trimmed-down version of Tron protobuf and uses it directly to calculate transaction size

Copyright (C) 2022 MrNaif2018

Licensed under the MIT License

Metadata

Release files for trontxsize 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trontxsize 1.3.0
File Size Uploaded Provenance Actions
trontxsize-1.3.0.tar.gz 8.4 kB With provenance Details for trontxsize-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trontxsize 1.3.0
File Interpreter ABI Platform Actions
trontxsize-1.3.0-py3-none-any.whl Python 3 none any Details for trontxsize-1.3.0-py3-none-any.whl

Total release size: 14.9 kB

Release files / trontxsize-1.3.0.tar.gz

Download URL trontxsize-1.3.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f0b8468d478245cd323bc5d44a4f022d77d68e8dabd8d55d09c106eaafc865c7
BLAKE2b-256 checksum
How to use checksums
0217c11758797278c30b0be32722ba26524644c0c70d22b1464ea8f54f2a3965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / trontxsize-1.3.0-py3-none-any.whl

Download URL trontxsize-1.3.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28567b66efb845b25f925f61cda33476869219447f755e1c232d8ef70c6ee854
BLAKE2b-256 checksum
How to use checksums
e6414c5a03b7ae71d53ab090f96484eadde60bfaef6bca4eb9afa05fe472e54a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for trontxsize 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for trontxsize-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page