public class TronSmartContract extends Object
Constructor and Description |
---|
TronSmartContract(Protocol.SmartContract.ABI abi) |
TronSmartContract(Protocol.SmartContract contract) |
Modifier and Type | Method and Description |
---|---|
void |
fillEventInformation(String eventName,
List<String> indexedNames,
List<String> indexedTypes,
List<String> notIndexedNames,
List<String> notIndexedTypes)
Fills the params with fields information about an event.
|
Protocol.SmartContract.ABI |
getAbi() |
String |
getABIString() |
String |
getByteCode() |
TronCurrency |
getCallValue() |
long |
getConsumeUserResourcePercent() |
List<String> |
getEventsSignatures() |
String |
getMethodsSignature(String methodName)
Gets a method signature from its name.
|
List<String> |
getMethodsSignatures() |
List<String> |
getResultNameForMethod(String method)
Gets the return names of a method.
|
List<String> |
getResultTypeForMethod(String method)
Gets the return types of a method.
|
Protocol.SmartContract.ABI.Entry.StateMutabilityType |
getStateMutability(String methodName)
gets the state mutability type for a method.
|
String |
interpretCall(byte[] data)
Interprets a method call bases on the smart contract ABI.
|
TronSmartContractEvent |
interpretLog(TronTransactionInformation.Log log)
Interprets a log as an event.
|
boolean |
isReadOnly(String methodName)
Checks if a method is read-only (pure or view).
|
void |
print(String indent)
Prints in stdout.
|
com.google.gson.JsonObject |
toJson() |
public TronSmartContract(Protocol.SmartContract contract)
public TronSmartContract(Protocol.SmartContract.ABI abi)
public Protocol.SmartContract.ABI getAbi()
public String getByteCode()
public TronCurrency getCallValue()
public long getConsumeUserResourcePercent()
public List<String> getMethodsSignatures()
public String getMethodsSignature(String methodName)
methodName
- the method name.public boolean isReadOnly(String methodName)
methodName
- The method name.public Protocol.SmartContract.ABI.Entry.StateMutabilityType getStateMutability(String methodName)
methodName
- The method name.public List<String> getEventsSignatures()
public List<String> getResultTypeForMethod(String method)
method
- the method.public List<String> getResultNameForMethod(String method)
method
- the method.public void fillEventInformation(String eventName, List<String> indexedNames, List<String> indexedTypes, List<String> notIndexedNames, List<String> notIndexedTypes)
eventName
- The event nameindexedNames
- destination for the indexed names.indexedTypes
- destination for the indexed types.notIndexedNames
- destination for the not indexed names.notIndexedTypes
- destination for the not indexed types.public TronSmartContractEvent interpretLog(TronTransactionInformation.Log log)
log
- The log.public String interpretCall(byte[] data)
data
- The call datapublic String getABIString()
public com.google.gson.JsonObject toJson()
public void print(String indent)
Copyright © 2020. All rights reserved.