public abstract class Contract extends Submit
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Contract.ContractOpType |
static class |
Contract.EventValuesWithLog
Adds a log field to
EventValues. |
Submit.CrossChainArgs, Submit.SchemaOpType, Submit.SubmitState, Submit.SyncCond, Submit.SyncState| 限定符和类型 | 字段和说明 |
|---|---|
protected Chainsql |
chainsql |
protected String |
contractAddress |
protected String |
contractBinary |
protected Map<String,String> |
deployedAddresses |
static String |
FUNC_DEPLOY |
static BigInteger |
GAS_LIMIT |
protected BigInteger |
gasLimit |
static BigInteger |
INITIAL_DROPS |
cache, cb, condition, connection, crossChainArgs, eventManager, extraDrop, mapToken, needVerify, schemaCreateTx, schemaModifyTx, signed, strictMode, transaction| 限定符 | 构造器和说明 |
|---|---|
protected |
Contract(Chainsql chainsql,
String contractBinary,
String contractAddress,
BigInteger gasLimit) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected static <S extends com.peersafe.abi.datatypes.Type,T> |
convertToNative(List<S> arr) |
protected static <T extends Contract> |
deploy(Class<T> type,
Chainsql chainsql,
BigInteger gasLimit,
String binary,
String encodedConstructor,
BigInteger value) |
protected static <T extends Contract> |
deploy(Class<T> type,
Chainsql chainsql,
BigInteger gasLimit,
String binary,
String encodedConstructor,
BigInteger value,
Publisher.Callback<T> cb) |
static <T extends Contract> |
deployRemoteCall(Class<T> type,
Chainsql chainsql,
BigInteger gasLimit,
String binary,
String encodedConstructor) |
static <T extends Contract> |
deployRemoteCall(Class<T> type,
Chainsql chainsql,
BigInteger gasLimit,
String binary,
String encodedConstructor,
BigInteger value) |
static <T extends Contract> |
deployRemoteCall(Class<T> type,
Chainsql chainsql,
BigInteger gasLimit,
String binary,
String encodedConstructor,
BigInteger value,
Publisher.Callback<T> cb) |
static <T extends Contract> |
deployRemoteCall(Class<T> type,
Chainsql chainsql,
BigInteger gasLimit,
String binary,
String encodedConstructor,
Publisher.Callback<T> cb) |
protected List<com.peersafe.abi.datatypes.Type> |
executeCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function) |
protected void |
executeCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function,
Publisher.Callback<List<com.peersafe.abi.datatypes.Type>> cb) |
protected <T extends com.peersafe.abi.datatypes.Type> |
executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function) |
protected <T extends com.peersafe.abi.datatypes.Type,R> |
executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<R> returnType) |
protected <T extends com.peersafe.abi.datatypes.Type,R> |
executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<R> returnType,
Publisher.Callback<R> cb) |
protected <T extends com.peersafe.abi.datatypes.Type> |
executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Publisher.Callback<T> cb) |
protected List<com.peersafe.abi.datatypes.Type> |
executeRemoteCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function) |
protected void |
executeRemoteCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function,
Publisher.Callback<List<com.peersafe.abi.datatypes.Type>> cb) |
protected <T extends com.peersafe.abi.datatypes.Type> |
executeRemoteCallSingleValueReturn(com.peersafe.abi.datatypes.Function function) |
protected <T> T |
executeRemoteCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<T> returnType) |
protected <T> void |
executeRemoteCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<T> returnType,
Publisher.Callback<T> cb) |
protected Contract |
executeRemoteCallTransaction(com.peersafe.abi.datatypes.Function function) |
protected Contract |
executeRemoteCallTransaction(com.peersafe.abi.datatypes.Function function,
BigInteger dropValue) |
protected Contract |
executeTransaction(com.peersafe.abi.datatypes.Function function) |
com.peersafe.abi.EventValues |
extractEventParameters(com.peersafe.abi.datatypes.Event event,
List<String> topics,
String logData) |
Chainsql |
getChainsql() |
String |
getContractAddress() |
String |
getContractBinary() |
String |
getDeployedAddress(String networkId) |
BigInteger |
getGasLimit() |
protected String |
getStaticDeployedAddress(String networkId)
Subclasses should implement this method to return pre-existing addresses for deployed
contracts.
|
protected void |
on(com.peersafe.abi.datatypes.Event event,
Publisher.Callback<com.peersafe.abi.EventValues> cb) |
protected org.json.JSONObject |
prepareSigned() |
void |
setContractAddress(String contractAddress) |
void |
setDeployedAddress(String networkId,
String address) |
void |
setTxJson(org.json.JSONObject json) |
doSubmit, doSubmitNoPrepare, eventManager, getTableArray, isCrossChainArgsSet, mapError, setCrossChainArgs, setCrossChainArgs, setNeedVerify, setRestrict, submit, submit, submit, toTransactionpublic static final BigInteger GAS_LIMIT
public static final BigInteger INITIAL_DROPS
protected final String contractBinary
protected String contractAddress
protected BigInteger gasLimit
protected Chainsql chainsql
protected Contract(Chainsql chainsql, String contractBinary, String contractAddress, BigInteger gasLimit)
public void setTxJson(org.json.JSONObject json)
public void setContractAddress(String contractAddress)
public String getContractAddress()
public String getContractBinary()
public BigInteger getGasLimit()
public Chainsql getChainsql()
protected <T extends com.peersafe.abi.datatypes.Type> T executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function)
throws ContractCallException
protected <T extends com.peersafe.abi.datatypes.Type> void executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Publisher.Callback<T> cb)
throws ContractCallException
protected <T extends com.peersafe.abi.datatypes.Type,R> R executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<R> returnType)
throws ContractCallException
protected <T extends com.peersafe.abi.datatypes.Type,R> void executeCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<R> returnType,
Publisher.Callback<R> cb)
throws ContractCallException
protected List<com.peersafe.abi.datatypes.Type> executeCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function) throws ContractCallException
protected void executeCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function,
Publisher.Callback<List<com.peersafe.abi.datatypes.Type>> cb)
throws ContractCallException
protected Contract executeTransaction(com.peersafe.abi.datatypes.Function function)
protected org.json.JSONObject prepareSigned()
prepareSigned 在类中 Submitprotected <T extends com.peersafe.abi.datatypes.Type> T executeRemoteCallSingleValueReturn(com.peersafe.abi.datatypes.Function function)
throws ContractCallException
protected <T> T executeRemoteCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<T> returnType)
throws ContractCallException
protected <T> void executeRemoteCallSingleValueReturn(com.peersafe.abi.datatypes.Function function,
Class<T> returnType,
Publisher.Callback<T> cb)
throws ContractCallException
protected List<com.peersafe.abi.datatypes.Type> executeRemoteCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function) throws ContractCallException
protected void executeRemoteCallMultipleValueReturn(com.peersafe.abi.datatypes.Function function,
Publisher.Callback<List<com.peersafe.abi.datatypes.Type>> cb)
throws ContractCallException
protected Contract executeRemoteCallTransaction(com.peersafe.abi.datatypes.Function function)
protected Contract executeRemoteCallTransaction(com.peersafe.abi.datatypes.Function function, BigInteger dropValue)
protected static <T extends Contract> T deploy(Class<T> type, Chainsql chainsql, BigInteger gasLimit, String binary, String encodedConstructor, BigInteger value) throws TransactionException
protected static <T extends Contract> void deploy(Class<T> type, Chainsql chainsql, BigInteger gasLimit, String binary, String encodedConstructor, BigInteger value, Publisher.Callback<T> cb) throws TransactionException
public static <T extends Contract> T deployRemoteCall(Class<T> type, Chainsql chainsql, BigInteger gasLimit, String binary, String encodedConstructor, BigInteger value) throws TransactionException
public static <T extends Contract> void deployRemoteCall(Class<T> type, Chainsql chainsql, BigInteger gasLimit, String binary, String encodedConstructor, BigInteger value, Publisher.Callback<T> cb) throws TransactionException
public static <T extends Contract> T deployRemoteCall(Class<T> type, Chainsql chainsql, BigInteger gasLimit, String binary, String encodedConstructor) throws TransactionException
public static <T extends Contract> void deployRemoteCall(Class<T> type, Chainsql chainsql, BigInteger gasLimit, String binary, String encodedConstructor, Publisher.Callback<T> cb) throws TransactionException
public com.peersafe.abi.EventValues extractEventParameters(com.peersafe.abi.datatypes.Event event,
List<String> topics,
String logData)
protected void on(com.peersafe.abi.datatypes.Event event,
Publisher.Callback<com.peersafe.abi.EventValues> cb)
protected String getStaticDeployedAddress(String networkId)
networkId - the network id, for example "1" for the main-net, "3" for ropsten, etc.Copyright © 2021. All rights reserved.