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.5.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.5.0
File Size Uploaded Provenance Actions
trontxsize-1.5.0.tar.gz 8.6 kB With provenance Details for trontxsize-1.5.0.tar.gz

Built distribution (wheel)

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

Total release size: 15.1 kB

Release files / trontxsize-1.5.0.tar.gz

Download URL trontxsize-1.5.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4c0d7c1eb1627bc1233b822f7b242db0e047b4363c352105cc4eac7fc65ac123
BLAKE2b-256 checksum
How to use checksums
bdfdfc1effe087850e61f21a5ebdf72404da20aea3f671418528e8e530fc15c1
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 5, 2026.

Transparency log

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

Download URL trontxsize-1.5.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dd32bf8c79b6bac353c309fb4da8b24c371ba5ba4acfdcd2fee2c3b190ad8a7
BLAKE2b-256 checksum
How to use checksums
82be5a5a8cf90dcf75c9d47b9f2bff7267cb51c05dceb66d88f591d66dffd4ea
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 5, 2026.

Transparency log

Security for trontxsize 1.5.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.5.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 5, 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