Migrating your code from v1 to v2¶
Changes to base API convenience methods¶
Tron.toDecimal() is renamed:
toInt() for improved clarity. It does not return a
decimal.Decimal, it returns an
tron.currentProvider was removed, in favor of
Disambiguating String Inputs¶
There are a number of places where an arbitrary string input might be either
a byte-string that has been hex-encoded, or unicode characters in text.
These are named
text in TronAPI.
You specify which kind of
str you have by using the appropriate
keyword argument. See examples in Type Conversions.
In v1, some methods accepted a
str as the first positional argument.
In v2, you must pass strings as one of
text keyword arguments.
Notable methods that no longer accept ambiguous strings: