Skip to content

Get size (bandwidth) of tron transactions

License

Notifications You must be signed in to change notification settings

bitcart/trontxsize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8461c67 · Jan 6, 2025

History

29 Commits
Dec 16, 2024
Sep 24, 2022
Dec 15, 2024
Sep 24, 2022
Jan 24, 2023
Jan 10, 2024
Dec 27, 2024
Dec 16, 2024
Sep 24, 2022
Jan 10, 2024
Dec 15, 2024
Aug 15, 2023
Dec 16, 2024
Dec 16, 2024
Jan 6, 2025

Repository files navigation

trontxsize - Calculate tron transaction size in bytes

CircleCI 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

print(trontxsize.get_tx_size({"raw_data": ..., "signatures": [...])) # 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 and License

Copyright (C) 2022 MrNaif2018

Licensed under the MIT License