public class ContractMethod
extends java.lang.Object
Constructor and Description |
---|
ContractMethod()
Creates a ContractMethod instance.
|
ContractMethod(Caver caver,
java.lang.String type,
java.lang.String name,
java.util.List<ContractIOType> inputs,
java.util.List<ContractIOType> outputs,
java.lang.String signature,
java.lang.String contractAddress)
Creates a ContractMethod instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<org.web3j.abi.datatypes.Type> |
call(java.util.List<java.lang.Object> arguments)
Execute smart contract method in the EVM without sending any transaction.
|
java.util.List<org.web3j.abi.datatypes.Type> |
call(java.util.List<java.lang.Object> arguments,
CallObject callObject)
Execute smart contract method in the EVM without sending any transaction.
|
java.util.List<org.web3j.abi.datatypes.Type> |
callWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> arguments)
Execute smart contract method in the EVM without sending any transaction.
|
java.util.List<org.web3j.abi.datatypes.Type> |
callWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> arguments,
CallObject callObject)
Execute smart contract method in the EVM without sending any transaction.
|
void |
checkTypeValid(java.util.List<java.lang.Object> types)
Check that passed parameter is valid to execute smart contract method.
|
java.lang.String |
encodeABI(java.util.List<java.lang.Object> arguments)
Encodes the ABI for this method.
|
java.lang.String |
encodeABIWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments)
Encodes the ABI for this method.
|
java.lang.String |
estimateGas(java.util.List<java.lang.Object> arguments,
CallObject callObject)
Estimate the gas to execute the contract's method.
|
java.lang.String |
estimateGasWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> arguments,
CallObject callObject)
Estimate the gas to execute the Contract's method using Solidity type wrapper class.
|
Caver |
getCaver()
Getter function for Caver.
|
java.lang.String |
getContractAddress()
Getter function for contract address
|
SendOptions |
getDefaultSendOptions()
Getter function for DefaultSendOptions
|
java.util.List<ContractIOType> |
getInputs()
Getter function for input.
|
java.lang.String |
getName()
Getter function for name.
|
java.util.List<ContractMethod> |
getNextContractMethods() |
java.util.List<ContractIOType> |
getOutputs()
Getter function for output.
|
java.lang.String |
getSignature()
Getter function for signature.
|
java.lang.String |
getType()
Getter function for type.
|
SendOptions |
makeSendOption(SendOptions sendOption)
Make SendOptions instance by comparing with defaultSendOption and passed parameter "options"
Passed parameter "options" has higher priority than "defaultSendOption" field.
|
TransactionReceipt.TransactionReceiptData |
send(java.util.List<java.lang.Object> arguments)
Send a transaction to smart contract and execute its method.
|
TransactionReceipt.TransactionReceiptData |
send(java.util.List<java.lang.Object> arguments,
SendOptions options)
Send a transaction to smart contract and execute its method.
|
TransactionReceipt.TransactionReceiptData |
send(java.util.List<java.lang.Object> arguments,
SendOptions options,
TransactionReceiptProcessor processor)
Send a transaction to smart contract and execute its method.
|
TransactionReceipt.TransactionReceiptData |
sendWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments)
Send a transaction to smart contract and execute its method using solidity type wrapper class.
|
TransactionReceipt.TransactionReceiptData |
sendWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments,
SendOptions options)
Send a transaction to smart contract and execute its method using solidity type wrapper class.
|
TransactionReceipt.TransactionReceiptData |
sendWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments,
SendOptions options,
TransactionReceiptProcessor processor)
Send a transaction to smart contract and execute its method using solidity type wrapper class.
|
void |
setWallet(IWallet wallet)
Setter function for wallet
|
public ContractMethod()
public ContractMethod(Caver caver, java.lang.String type, java.lang.String name, java.util.List<ContractIOType> inputs, java.util.List<ContractIOType> outputs, java.lang.String signature, java.lang.String contractAddress)
caver
- A Caver instance.type
- The input type. It always set "function"name
- The function nameinputs
- The list of ContractIOType contains to function parameter information.outputs
- The list of ContractIOTypesignature
- The function signature string.contractAddress
- The contract addresspublic java.util.List<org.web3j.abi.datatypes.Type> call(java.util.List<java.lang.Object> arguments) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter to call smart contract method.java.io.IOException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.util.List<org.web3j.abi.datatypes.Type> call(java.util.List<java.lang.Object> arguments, CallObject callObject) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter to call smart contract method.callObject
- A CallObject instance to 'call' smart contract method.java.io.IOException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.util.List<org.web3j.abi.datatypes.Type> callWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> arguments) throws java.io.IOException, java.lang.ClassNotFoundException
arguments
- A List of parameter that solidity wrapper type to call smart contract method.java.io.IOException
java.lang.ClassNotFoundException
public java.util.List<org.web3j.abi.datatypes.Type> callWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> arguments, CallObject callObject) throws java.io.IOException, java.lang.ClassNotFoundException
arguments
- A List of parameter that solidity wrapper type to call smart contract method.callObject
- A CallObject instance to 'call' smart contract method.java.io.IOException
java.lang.ClassNotFoundException
public TransactionReceipt.TransactionReceiptData send(java.util.List<java.lang.Object> arguments) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter to call smart contract method.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public TransactionReceipt.TransactionReceiptData send(java.util.List<java.lang.Object> arguments, SendOptions options) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter to call smart contract method.options
- An option to execute smart contract method.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public TransactionReceipt.TransactionReceiptData send(java.util.List<java.lang.Object> arguments, SendOptions options, TransactionReceiptProcessor processor) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter to call smart contract method.options
- An option to execute smart contract method.processor
- A TransactionReceiptProcessor to get receipt.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public TransactionReceipt.TransactionReceiptData sendWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException
wrapperArguments
- A List of parameter that wrapped solidity wrapper class.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
public TransactionReceipt.TransactionReceiptData sendWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments, SendOptions options) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException
wrapperArguments
- A List of parameter that wrapped solidity wrapper class.options
- An option to execute smart contract method.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
public TransactionReceipt.TransactionReceiptData sendWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments, SendOptions options, TransactionReceiptProcessor processor) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException
wrapperArguments
- A List of parameter that wrapped solidity wrapper class.options
- An option to execute smart contract method.processor
- A TransactionReceiptProcessor to get receipt.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
public java.lang.String encodeABI(java.util.List<java.lang.Object> arguments) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter to encode function signature and parametersjava.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.lang.String encodeABIWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> wrapperArguments)
wrapperArguments
- A List of parameter that solidity wrapper classpublic java.lang.String estimateGas(java.util.List<java.lang.Object> arguments, CallObject callObject) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
arguments
- A List of parameter that solidity wrapper typecallObject
- An option to execute smart contract method.java.io.IOException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public java.lang.String estimateGasWithSolidityWrapper(java.util.List<org.web3j.abi.datatypes.Type> arguments, CallObject callObject) throws java.io.IOException
arguments
- The arguments that need to execute smart contract method.callObject
- An option to execute smart contract method.java.io.IOException
public void checkTypeValid(java.util.List<java.lang.Object> types)
types
- A List of parameter that solidity wrapper typepublic Caver getCaver()
public java.lang.String getType()
public java.lang.String getName()
public java.util.List<ContractIOType> getInputs()
public java.util.List<ContractIOType> getOutputs()
public java.lang.String getSignature()
public java.lang.String getContractAddress()
public SendOptions getDefaultSendOptions()
public java.util.List<ContractMethod> getNextContractMethods()
public void setWallet(IWallet wallet)
wallet
- The class instance implemented IWallet interface to sign transaction.public SendOptions makeSendOption(SendOptions sendOption)
sendOption
- SendOptions instance