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 |
---|---|
Contract |
deploy(ContractDeployParams deployParam,
SendOptions sendOptions)
Deploy a contract.
|
Contract |
deploy(ContractDeployParams deployParam,
SendOptions sendOptions,
TransactionReceiptProcessor processor)
Deploy a contract
|
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.
|
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.
|
void |
setDefaultSendOptions(SendOptions defaultSendOptions)
Setter function for defaultSendOption
|
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(ContractDeployParams deployParam, SendOptions sendOptions) throws java.io.IOException, org.web3j.protocol.exceptions.TransactionException, java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException, java.lang.IllegalAccessException
deployParam
- A DeployParam instance.sendOptions
- A SendOption instance.java.io.IOException
org.web3j.protocol.exceptions.TransactionException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
java.lang.IllegalAccessException
public Contract deploy(ContractDeployParams deployParam, SendOptions sendOptions, 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
deployParam
- A DeployParam instance.sendOptions
- A SendOption instance.processor
- A TransactionReceiptProcessor instance.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 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 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 void setDefaultSendOptions(SendOptions defaultSendOptions)
defaultSendOptions
- The sendOptions to set DefaultSendOptions field.