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.4.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.4.0
File Size Uploaded Provenance Actions
trontxsize-1.4.0.tar.gz 8.4 kB With provenance Details for trontxsize-1.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 15.0 kB

Release files / trontxsize-1.4.0.tar.gz

Download URL trontxsize-1.4.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9c79f2dac6e4026bf6fe7810207bd33e4a3451419c1766b618a877f369648028
BLAKE2b-256 checksum
How to use checksums
6ce7e1c19784978138949a7afbd576d5ab7966be2c99a48ca7a1b55f194da027
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 Nov 1, 2026.

Transparency log

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

Download URL trontxsize-1.4.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7490d39f080a0e8ff4127af1cb872f953986f8c1733c8292ec958e185cfab9c
BLAKE2b-256 checksum
How to use checksums
81390448c0ff146b181bcc68e6c2cf8c7873db8038dc1bfd5f05eb2b566c9fc9
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 Nov 1, 2026.

Transparency log

Security for trontxsize 1.4.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.4.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 Nov 1, 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