public class AssembleTransactionService
extends java.lang.Object
codec(abi, method, params) -> inputData sendTx(to, inputData) -> receipt decode(abi, method, receipt.output, ) -> result
| 限定符和类型 | 字段和说明 |
|---|---|
protected Client |
client |
protected ContractCodec |
contractCodec |
protected TransactionDecoderInterface |
transactionDecoder |
protected TransactionManager |
transactionManager |
| 构造器和说明 |
|---|
AssembleTransactionService(Client client) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
asyncDeployContract(BasicDeployRequest request,
TransactionCallback callback)
This method is used to deploy a contract asynchronously.
|
void |
asyncSendCall(BasicRequest request,
RespCallback<CallResponse> callback)
This method is used to send a call asynchronously.
|
java.lang.String |
asyncSendTransaction(BasicRequest request,
TransactionCallback callback)
This method is used to send a transaction asynchronously.
|
TransactionResponse |
deployContract(BasicDeployRequest request)
This method is used to deploy a contract.
|
CallResponse |
sendCall(BasicRequest request)
This method is used to send a call.
|
TransactionResponse |
sendTransaction(BasicRequest request)
This method is used to send a transaction.
|
void |
setTransactionManager(TransactionManager transactionManager)
Sets the TransactionManager for this service.
|
protected TransactionManager transactionManager
protected final TransactionDecoderInterface transactionDecoder
protected final ContractCodec contractCodec
protected final Client client
public AssembleTransactionService(Client client)
public void setTransactionManager(TransactionManager transactionManager)
ProxySignTransactionManager can be used to sign transactions with a proxy account, you can change account easily.
transactionManager - the TransactionManager to be setpublic TransactionResponse sendTransaction(BasicRequest request) throws ContractCodecException, org.fisco.bcos.sdk.jni.common.JniException
If the request is an instance of TransactionRequest, it encodes the method with the parameters from the request.
If the request is an instance of TransactionRequestWithStringParams, it encodes the method with the string parameters from the request.
If the request is not an instance of either, it throws a ContractCodecException.
request - the request containing the necessary information to send the transactionContractCodecException - if there is an error with the contract codec or the request is
not an instance of TransactionRequest or TransactionRequestWithStringParamsorg.fisco.bcos.sdk.jni.common.JniException - if there is an error with the JNIpublic TransactionResponse deployContract(BasicDeployRequest request) throws ContractCodecException, org.fisco.bcos.sdk.jni.common.JniException
If the request is an instance of DeployTransactionRequest, it encodes the constructor with the parameters from the request.
If the request is an instance of DeployTransactionRequestWithStringParams, it encodes the constructor with the string parameters from the request.
If the request is not an instance of either, it throws a ContractCodecException.
request - the request containing the necessary information to deploy the contractContractCodecException - if there is an error with the contract codec or the request is
not an instance of DeployTransactionRequest or DeployTransactionRequestWithStringParamsorg.fisco.bcos.sdk.jni.common.JniException - if there is an error with the JNIpublic java.lang.String asyncSendTransaction(BasicRequest request, TransactionCallback callback) throws ContractCodecException, org.fisco.bcos.sdk.jni.common.JniException
If the request is an instance of TransactionRequest, it encodes the method with the parameters from the request.
If the request is an instance of TransactionRequestWithStringParams, it encodes the method with the string parameters from the request.
If the request is not an instance of either, it throws a ContractCodecException.
request - the request containing the necessary information to send the transactioncallback - the callback to be called when the transaction is sentContractCodecException - if there is an error with the contract codec or the request is
not an instance of TransactionRequest or TransactionRequestWithStringParamsorg.fisco.bcos.sdk.jni.common.JniException - if there is an error with the JNIpublic java.lang.String asyncDeployContract(BasicDeployRequest request, TransactionCallback callback) throws ContractCodecException, org.fisco.bcos.sdk.jni.common.JniException
If the request is an instance of DeployTransactionRequest, it encodes the constructor with the parameters from the request.
If the request is an instance of DeployTransactionRequestWithStringParams, it encodes the constructor with the string parameters from the request.
If the request is not an instance of either, it throws a ContractCodecException.
request - the request containing the necessary information to deploy the contractcallback - the callback to be called when the transaction is sentContractCodecException - if there is an error with the contract codec or the request is
not an instance of DeployTransactionRequest or DeployTransactionRequestWithStringParamsorg.fisco.bcos.sdk.jni.common.JniException - if there is an error with the JNIpublic CallResponse sendCall(BasicRequest request) throws ContractCodecException, org.fisco.bcos.sdk.jni.common.JniException
If the request is an instance of TransactionRequest, it encodes the method with the parameters from the request.
If the request is an instance of TransactionRequestWithStringParams, it encodes the method with the string parameters from the request.
If the request is not an instance of either, it throws a ContractCodecException.
request - the request containing the necessary information to send the callContractCodecException - if there is an error with the contract codec or the request is
not an instance of TransactionRequest or TransactionRequestWithStringParamsorg.fisco.bcos.sdk.jni.common.JniException - if there is an error with the JNIpublic void asyncSendCall(BasicRequest request, RespCallback<CallResponse> callback) throws ContractCodecException
If the request is an instance of TransactionRequest, it encodes the method with the parameters from the request.
If the request is an instance of TransactionRequestWithStringParams, it encodes the method with the string parameters from the request.
If the request is not an instance of either, it throws a ContractCodecException.
request - the request containing the necessary information to send the callcallback - the callback to be called when the call is sentContractCodecException - if there is an error with the contract codec or the request is
not an instance of TransactionRequest or TransactionRequestWithStringParams