Constructor and Description |
---|
Contract(Caver caver,
java.lang.String abi)
Creates a Contract instance.
|
Contract(Caver caver,
java.lang.String abi,
java.lang.String contractAddress)
Creates a Contract instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<org.web3j.abi.datatypes.Type> |
call(CallObject callObject,
java.lang.String methodName,
java.lang.Object... methodArguments)
Execute smart contract method in the EVM without sending any transaction.
|
java.util.List<org.web3j.abi.datatypes.Type> |
call(java.lang.String methodName,
java.lang.Object... methodArguments)
Execute smart contract method in the EVM without sending any transaction.
|
java.util.List<org.web3j.abi.datatypes.Type> |
callWithSolidityType(CallObject callObject,
java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Execute smart contract method in the EVM without sending any transaction.
|
java.util.List<org.web3j.abi.datatypes.Type> |
callWithSolidityType(java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Execute smart contract method in the EVM without sending any transaction.
|
Contract |
deploy(ContractDeployParams deployParam,
SendOptions sendOptions)
Deploy a contract.
|
Contract |
deploy(ContractDeployParams deployParam,
SendOptions sendOptions,
TransactionReceiptProcessor processor)
Deploy a contract
|
Contract |
deploy(SendOptions sendOptions,
java.lang.String contractBinaryData,
java.lang.Object... constructorParams)
Deploy a contract
|
Contract |
deploy(SendOptions sendOptions,
TransactionReceiptProcessor receiptProcessor,
java.lang.String contractBinaryData,
java.lang.Object... constructorParams)
Deploy a contract
|
java.lang.String |
encodeABI(java.lang.String methodName,
java.lang.Object... methodArguments)
Encodes the ABI for the method in Contract.
|
java.lang.String |
encodeABIWithSolidityType(java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Encodes the ABI for the method in Contract with Solidity type wrapper reference.
|
java.lang.String |
estimateGas(CallObject callObject,
java.lang.String methodName,
java.lang.Object... methodArguments)
Estimate the gas to execute the contract's method.
|
java.lang.String |
estimateGasWithSolidityType(CallObject callObject,
java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Estimate the gas to execute the contract's method with Solidity type wrapper reference.
|
java.lang.String |
getAbi()
Getter function for contract's abi.
|
Caver |
getCaver()
Getter function for caver.
|
ContractMethod |
getConstructor()
Getter function for Contract's constructor function info.
|
java.lang.String |
getContractAddress()
Getter function for contract address.
|
SendOptions |
getDefaultSendOptions()
Getter function for DefaultSendOptions
|
ContractEvent |
getEvent(java.lang.String eventName)
Returns the ContractEvent instance corresponding to the event name.
|
java.util.Map<java.lang.String,ContractEvent> |
getEvents()
Getter function for events.
|
ContractMethod |
getMethod(java.lang.String methodName)
Returns the ContractMethod instance corresponding to the method name.
|
java.util.Map<java.lang.String,ContractMethod> |
getMethods()
Getter function for methods.
|
KlayLogs |
getPastEvent(java.lang.String eventName,
KlayLogFilter filterOption)
Get past events for this contract.
|
IWallet |
getWallet()
Getter function for wallet
|
io.reactivex.disposables.Disposable |
once(java.lang.String eventName,
EventFilterOptions paramsOption,
io.reactivex.functions.Consumer<org.web3j.protocol.websocket.events.LogNotification> callback)
Subscribes to an event and unsubscribes immediately after the first event or error.
|
TransactionReceipt.TransactionReceiptData |
send(SendOptions options,
java.lang.String methodName,
java.lang.Object... methodArguments)
Send a transaction to smart contract and execute its method.
|
TransactionReceipt.TransactionReceiptData |
send(SendOptions options,
TransactionReceiptProcessor receiptProcessor,
java.lang.String methodName,
java.lang.Object... methodArguments)
Send a transaction to smart contract and execute its method.
|
TransactionReceipt.TransactionReceiptData |
send(java.lang.String methodName,
java.lang.Object... methodArguments)
Send a transaction to smart contract and execute its method.
|
TransactionReceipt.TransactionReceiptData |
sendWithSolidityType(SendOptions options,
java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Send a transaction to smart contract and execute its method using solidity type wrapper class.
|
TransactionReceipt.TransactionReceiptData |
sendWithSolidityType(SendOptions options,
TransactionReceiptProcessor receiptProcessor,
java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Send a transaction to smart contract and execute its method using solidity type wrapper class.
|
TransactionReceipt.TransactionReceiptData |
sendWithSolidityType(java.lang.String methodName,
org.web3j.abi.datatypes.Type... methodArguments)
Send a transaction to smart contract and execute its method using solidity type wrapper class.
|
void |
setDefaultSendOptions(SendOptions defaultSendOptions)
Setter function for defaultSendOption
|
void |
setWallet(IWallet wallet)
Setter function for wallet
|
public Contract(Caver caver, java.lang.String abi) throws java.io.IOException
caver
- A Caver instance.abi
- A contract's ABI(Application Binary interface) json string.java.io.IOException
public Contract(Caver caver, java.lang.String abi, java.lang.String contractAddress) throws java.io.IOException
caver
- A Caver instanceabi
- A contract's ABI(Application Binary Interface) json string.contractAddress
- An address string of contract deployed on Klaytn.java.io.IOException
public Contract deploy(SendOptions sendOptions, java.lang.String contractBinaryData, java.lang.Object... constructorParams) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
sendOptions
- A SendOption instance.contractBinaryData
- A smart contract binary data.constructorParams
- The smart contract constructor parameters.org.web3j.protocol.exceptions.TransactionException
java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public Contract deploy(SendOptions sendOptions, TransactionReceiptProcessor receiptProcessor, java.lang.String contractBinaryData, java.lang.Object... constructorParams) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
sendOptions
- A SendOption instancereceiptProcessor
- A TransactionReceiptProcessor instance.contractBinaryData
- A smart contract binary data.constructorParams
- The smart contract constructor parameters.org.web3j.protocol.exceptions.TransactionException
java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public Contract deploy(ContractDeployParams deployParam, SendOptions sendOptions) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
deployParam
- A DeployParam instance.sendOptions
- A SendOption instance.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public Contract deploy(ContractDeployParams deployParam, SendOptions sendOptions, TransactionReceiptProcessor processor) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
deployParam
- A DeployParam instance.sendOptions
- A SendOption instance.processor
- A TransactionReceiptProcessor instance.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public io.reactivex.disposables.Disposable once(java.lang.String eventName, EventFilterOptions paramsOption, io.reactivex.functions.Consumer<org.web3j.protocol.websocket.events.LogNotification> callback) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.IllegalAccessException
eventName
- The name of the event in the contract.paramsOption
- The filter events by indexed parameters.callback
- The callback function that handled to returned data.java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.IllegalAccessException
public KlayLogs getPastEvent(java.lang.String eventName, KlayLogFilter filterOption) throws java.io.IOException
eventName
- The name of the event in the contract.filterOption
- The KlayLogFilter instance to filter event.java.io.IOException
public java.util.List<org.web3j.abi.datatypes.Type> call(java.lang.String methodName, java.lang.Object... methodArguments) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.IllegalAccessException
methodName
- The smart contract method name to execute.methodArguments
- The arguments that need to execute smart contract method.java.io.IOException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.util.List<org.web3j.abi.datatypes.Type> call(CallObject callObject, java.lang.String methodName, java.lang.Object... methodArguments) throws java.io.IOException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.IllegalAccessException
callObject
- A CallObject instance to 'call' smart contract method.methodName
- The smart contract method name to execute.methodArguments
- The arguments that need to execute smart contract method.java.io.IOException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.util.List<org.web3j.abi.datatypes.Type> callWithSolidityType(java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments) throws java.io.IOException, java.lang.ClassNotFoundException
methodName
- The smart contract method name to execute.methodArguments
- The arguments that need to execute smart contract method.java.io.IOException
java.lang.ClassNotFoundException
public java.util.List<org.web3j.abi.datatypes.Type> callWithSolidityType(CallObject callObject, java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments) throws java.io.IOException, java.lang.ClassNotFoundException
callObject
- A CallObject instance to 'call' smart contract method.methodName
- The smart contract method name to execute.methodArguments
- The arguments that need to execute smart contract method.java.io.IOException
java.lang.ClassNotFoundException
public TransactionReceipt.TransactionReceiptData send(java.lang.String methodName, java.lang.Object... methodArguments) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
methodName
- The smart contract method name to executemethodArguments
- The arguments that need to execute smart contract method.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public TransactionReceipt.TransactionReceiptData send(SendOptions options, java.lang.String methodName, java.lang.Object... methodArguments) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
options
- An option to execute smart contract method.methodName
- The smart contract method name to executemethodArguments
- The arguments that need to execute smart contract method.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public TransactionReceipt.TransactionReceiptData send(SendOptions options, TransactionReceiptProcessor receiptProcessor, java.lang.String methodName, java.lang.Object... methodArguments) throws org.web3j.protocol.exceptions.TransactionException, java.io.IOException, java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
options
- An option to execute smart contract method.receiptProcessor
- A TransactionReceiptProcessor to get receipt.methodName
- The smart contract method name to executemethodArguments
- The arguments that need to execute smart contract method.org.web3j.protocol.exceptions.TransactionException
java.io.IOException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
public TransactionReceipt.TransactionReceiptData sendWithSolidityType(java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException
methodName
- The smart contract method name to executemethodArguments
- The arguments that need to execute smart contract method.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
public TransactionReceipt.TransactionReceiptData sendWithSolidityType(SendOptions options, java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException
options
- An option to execute smart contract method.methodName
- The smart contract method name to executemethodArguments
- The arguments that need to execute smart contract method.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
public TransactionReceipt.TransactionReceiptData sendWithSolidityType(SendOptions options, TransactionReceiptProcessor receiptProcessor, java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException
options
- An option to execute smart contract method.receiptProcessor
- A TransactionReceiptProcessor to get receipt.methodName
- The smart contract method name to executemethodArguments
- The arguments that need to execute smart contract method.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
public java.lang.String encodeABI(java.lang.String methodName, java.lang.Object... methodArguments) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.IllegalAccessException
methodName
- The smart contract method name to encode.methodArguments
- The arguments that need to execute smart contract method.java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.IllegalAccessException
public java.lang.String encodeABIWithSolidityType(java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments)
methodName
- The smart contract method name to encode.methodArguments
- The arguments that need to execute smart contract method.public java.lang.String estimateGas(CallObject callObject, java.lang.String methodName, java.lang.Object... methodArguments) throws java.lang.NoSuchMethodException, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.ClassNotFoundException
callObject
- An option to execute smart contract method.methodName
- The smart contract method name.methodArguments
- The arguments that need to execute smart contract method.java.lang.NoSuchMethodException
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
public java.lang.String estimateGasWithSolidityType(CallObject callObject, java.lang.String methodName, org.web3j.abi.datatypes.Type... methodArguments) throws java.io.IOException
callObject
- An option to execute smart contract method.methodName
- The smart contract method name.methodArguments
- The arguments that need to execute smart contract method.java.io.IOException
public ContractMethod getMethod(java.lang.String methodName)
methodName
- The method name.public ContractEvent getEvent(java.lang.String eventName)
eventName
- The event name.public Caver getCaver()
public java.lang.String getAbi()
public java.lang.String getContractAddress()
public java.util.Map<java.lang.String,ContractMethod> getMethods()
public java.util.Map<java.lang.String,ContractEvent> getEvents()
public ContractMethod getConstructor()
public SendOptions getDefaultSendOptions()
public IWallet getWallet()
public void setWallet(IWallet wallet)
wallet
- The class instance implemented IWallet to sign transaction.public void setDefaultSendOptions(SendOptions defaultSendOptions)
defaultSendOptions
- The sendOptions to set DefaultSendOptions field.