public class TronUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ADDRESS_SIZE |
static byte |
PREFIX_BYTE |
Constructor and Description |
---|
TronUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
abi2Json(Protocol.SmartContract.ABI abi) |
static List<String> |
asStringsList(Object array)
Turns an array into a string list.
|
static byte[] |
decodeFromBase58(String addressBase58)
Decodes a base-58 address.
|
static BigInteger |
doubleToInt(double value,
int decimals)
Turns a double value into an integer.
|
static String |
encodeToBase58Check(byte[] input)
Encodes to base-58 (with check code).
|
static double |
intToDouble(BigInteger value,
int decimals)
Turns an integer value into double with decimals.
|
static Protocol.SmartContract.ABI |
jsonToABI(String json) |
static byte[] |
keccak256(byte[] input)
Calculates the hash of an input.
|
static String |
minimizeJson(String in) |
static boolean |
validateAddress(String address)
Validates an address.
|
static String |
valueToString(Object value)
Gets a value as string.
|
public static final byte PREFIX_BYTE
public static final int ADDRESS_SIZE
public static byte[] decodeFromBase58(String addressBase58)
addressBase58
- The base-58 string.public static String encodeToBase58Check(byte[] input)
input
- The byte array to encode.public static boolean validateAddress(String address)
address
- The address.public static BigInteger doubleToInt(double value, int decimals)
value
- The double value.decimals
- The number of decimalspublic static double intToDouble(BigInteger value, int decimals)
value
- The integer value.decimals
- The number of decimals.public static byte[] keccak256(byte[] input)
input
- input datapublic static String valueToString(Object value)
value
- The value.public static List<String> asStringsList(Object array)
array
- The array.public static String abi2Json(Protocol.SmartContract.ABI abi)
public static Protocol.SmartContract.ABI jsonToABI(String json) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
Copyright © 2020. All rights reserved.