public class EthereumUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_ATTEMPTS |
static BigInteger |
DEFAULT_GAS_LIMIT |
static BigInteger |
DEFAULT_GAS_PRICE |
static int |
DEFAULT_SLEEP_DURATION |
static String |
TMP_FILE_PREFIX |
static String |
TMP_FILE_SUFFIX |
| Constructor and Description |
|---|
EthereumUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertStreamToStr(InputStream inputStream) |
static File |
createTmpFile(InputStream in) |
static File |
createTmpFile(InputStream in,
String filePrefix,
String fileSuffix) |
static String |
deployContract(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j,
String contractBinary,
int toSendEther,
boolean waitForReceipt,
int sleepDuration,
int attempts) |
static BigDecimal |
getBalanceInEther(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j) |
static String |
getEncodedFunction(org.web3j.abi.datatypes.Function function) |
static String |
getEncodedFunction(String queryName,
List<org.web3j.abi.datatypes.Type> queryInputTypes,
List<org.web3j.abi.TypeReference<?>> queryOutputTypes) |
static org.web3j.abi.datatypes.Function |
getFunction(String queryName,
List<org.web3j.abi.datatypes.Type> queryInputTypes,
List<org.web3j.abi.TypeReference<?>> queryOutputTypes) |
static BigInteger |
getNextNonce(String address,
org.web3j.protocol.Web3j web3j) |
static Optional<org.web3j.protocol.core.methods.response.TransactionReceipt> |
getTransactionReceipt(String transactionHash,
int sleepDuration,
int attempts,
org.web3j.protocol.Web3j web3j) |
static void |
observeContractEvent(org.web3j.protocol.Web3j web3j,
String contractEventName,
String contractAddress,
List<org.web3j.abi.TypeReference<?>> indexedParameters,
List<org.web3j.abi.TypeReference<?>> nonIndexedParameters,
String eventReturnType,
rx.functions.Action1 action1) |
static void |
observeContractEvent(org.web3j.protocol.Web3j web3j,
String contractEventName,
String contractAddress,
List<org.web3j.abi.TypeReference<?>> indexedParameters,
List<org.web3j.abi.TypeReference<?>> nonIndexedParameters,
String eventReturnType,
org.kie.api.runtime.KieSession kieSession,
String signalName,
boolean doAbortOnUpdate,
org.kie.api.runtime.process.WorkItemManager workItemManager,
org.kie.api.runtime.process.WorkItem workItem) |
static Object |
queryExistingContract(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j,
String contractAddress,
String contractMethodName,
List<org.web3j.abi.datatypes.Type> contractMethodInputTypes,
List<org.web3j.abi.TypeReference<?>> contractMethodOutputTypes) |
static org.web3j.protocol.core.methods.response.TransactionReceipt |
sendFundsToContract(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j,
int etherAmount,
String toAddress,
org.web3j.tx.Transfer transfer) |
static Optional<org.web3j.protocol.core.methods.response.TransactionReceipt> |
sendTransactionReceiptRequest(String transactionHash,
org.web3j.protocol.Web3j web3j) |
static org.web3j.protocol.core.methods.response.TransactionReceipt |
transactExistingContract(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j,
int etherAmount,
BigInteger gasPrice,
BigInteger gasLimit,
String toAddress,
String methodName,
List<org.web3j.abi.datatypes.Type> methodInputTypes,
List<org.web3j.abi.TypeReference<?>> methodOutputTypes,
boolean waitForReceipt,
int sleepDuration,
int attempts) |
static org.web3j.protocol.core.methods.response.TransactionReceipt |
waitForTransactionReceipt(String transactionHash,
int sleepDuration,
int attempts,
org.web3j.protocol.Web3j web3j) |
public static final BigInteger DEFAULT_GAS_PRICE
public static final BigInteger DEFAULT_GAS_LIMIT
public static final int DEFAULT_SLEEP_DURATION
public static final int DEFAULT_ATTEMPTS
public static final String TMP_FILE_PREFIX
public static final String TMP_FILE_SUFFIX
public static org.web3j.abi.datatypes.Function getFunction(String queryName, List<org.web3j.abi.datatypes.Type> queryInputTypes, List<org.web3j.abi.TypeReference<?>> queryOutputTypes)
public static String getEncodedFunction(String queryName, List<org.web3j.abi.datatypes.Type> queryInputTypes, List<org.web3j.abi.TypeReference<?>> queryOutputTypes)
public static String getEncodedFunction(org.web3j.abi.datatypes.Function function)
public static BigInteger getNextNonce(String address, org.web3j.protocol.Web3j web3j) throws Exception
Exceptionpublic static BigDecimal getBalanceInEther(org.web3j.crypto.Credentials credentials, org.web3j.protocol.Web3j web3j) throws Exception
Exceptionpublic static String deployContract(org.web3j.crypto.Credentials credentials, org.web3j.protocol.Web3j web3j, String contractBinary, int toSendEther, boolean waitForReceipt, int sleepDuration, int attempts) throws Exception
Exceptionpublic static Object queryExistingContract(org.web3j.crypto.Credentials credentials, org.web3j.protocol.Web3j web3j, String contractAddress, String contractMethodName, List<org.web3j.abi.datatypes.Type> contractMethodInputTypes, List<org.web3j.abi.TypeReference<?>> contractMethodOutputTypes) throws Exception
Exceptionpublic static org.web3j.protocol.core.methods.response.TransactionReceipt transactExistingContract(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j,
int etherAmount,
BigInteger gasPrice,
BigInteger gasLimit,
String toAddress,
String methodName,
List<org.web3j.abi.datatypes.Type> methodInputTypes,
List<org.web3j.abi.TypeReference<?>> methodOutputTypes,
boolean waitForReceipt,
int sleepDuration,
int attempts)
throws Exception
Exceptionpublic static org.web3j.protocol.core.methods.response.TransactionReceipt sendFundsToContract(org.web3j.crypto.Credentials credentials,
org.web3j.protocol.Web3j web3j,
int etherAmount,
String toAddress,
org.web3j.tx.Transfer transfer)
throws Exception
Exceptionpublic static org.web3j.protocol.core.methods.response.TransactionReceipt waitForTransactionReceipt(String transactionHash, int sleepDuration, int attempts, org.web3j.protocol.Web3j web3j) throws Exception
Exceptionpublic static Optional<org.web3j.protocol.core.methods.response.TransactionReceipt> getTransactionReceipt(String transactionHash, int sleepDuration, int attempts, org.web3j.protocol.Web3j web3j) throws Exception
Exceptionpublic static Optional<org.web3j.protocol.core.methods.response.TransactionReceipt> sendTransactionReceiptRequest(String transactionHash, org.web3j.protocol.Web3j web3j) throws Exception
Exceptionpublic static void observeContractEvent(org.web3j.protocol.Web3j web3j,
String contractEventName,
String contractAddress,
List<org.web3j.abi.TypeReference<?>> indexedParameters,
List<org.web3j.abi.TypeReference<?>> nonIndexedParameters,
String eventReturnType,
org.kie.api.runtime.KieSession kieSession,
String signalName,
boolean doAbortOnUpdate,
org.kie.api.runtime.process.WorkItemManager workItemManager,
org.kie.api.runtime.process.WorkItem workItem)
public static void observeContractEvent(org.web3j.protocol.Web3j web3j,
String contractEventName,
String contractAddress,
List<org.web3j.abi.TypeReference<?>> indexedParameters,
List<org.web3j.abi.TypeReference<?>> nonIndexedParameters,
String eventReturnType,
rx.functions.Action1 action1)
public static File createTmpFile(InputStream in) throws IOException
IOExceptionpublic static File createTmpFile(InputStream in, String filePrefix, String fileSuffix) throws IOException
IOExceptionpublic static String convertStreamToStr(InputStream inputStream) throws IOException
IOExceptionCopyright © 2001–2020 jBPM dev team. All rights reserved.