Module java4ever.framework
Package tech.deplant.java4ever.framework
Record Class FunctionHandle<RETURN>
java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.FunctionHandle<RETURN>
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionHandle(Class<RETURN> clazz, Sdk sdk, String address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Creates an instance of aFunctionHandlerecord class.FunctionHandle(Sdk sdk, String address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) -
Method Summary
Modifier and TypeMethodDescriptionabi()Returns the value of theabirecord component.address()Returns the value of theaddressrecord component.call()Calls smart contract with external message using credentials provided on initialization.callLocal(String boc, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options, boolean unlimitedBalance) Calls smart contract with external message using credentials provided on initialization.callLocalAsMap(String boc, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options, boolean unlimitedBalance) Encodes inputs and runs external call method on account's boc then decodes answer.callTree(boolean throwOnTreeError, List<ContractAbi> otherAbisForDecode) As with call(), this method send ext message to Everscale but callTree() also queries message tree with "net.query_transaction_tree" returns a set of messages and transactions, logs everything and throws exceptions on errors encountered in a tree.callTreeAsMap(boolean throwOnTreeError, List<ContractAbi> otherAbisForDecode) As with call(), this method send ext message to Everscale but callTree() also queries message tree with "net.query_transaction_tree" returns a set of messages and transactions, logs everything and throws exceptions on errors encountered in a tree.clazz()Returns the value of theclazzrecord component.Returns the value of thecredentialsrecord component.final booleanIndicates whether some other object is "equal to" this one.tech.deplant.java4ever.binding.Abi.FunctionHeaderReturns the value of thefunctionHeaderrecord component.Returns the value of thefunctionInputsrecord component.Returns the value of thefunctionNamerecord component.get()Encodes inputs and run getter method on account's boc then decodes answer.getAsMap()Encodes inputs and run getter method on account's boc then decodes answer.Encodes inputs and run getter method on account's boc then decodes answer.getLocalAsMap(String boc) Encodes inputs and runs getter method on account's boc then decodes answer.final inthashCode()Returns a hash code value for this object.sdk()Returns the value of thesdkrecord component.tech.deplant.java4ever.binding.Abi.CallSetEncodes internal message string.tech.deplant.java4ever.binding.Abi.SignertoSigner()final StringtoString()Returns a string representation of this record class.withCredentials(Credentials credentials) withFunctionHeader(tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) withFunctionInputs(Map<String, Object> functionInputs) <T> FunctionHandle<T>withReturnClass(Class<T> returnClass)
-
Constructor Details
-
FunctionHandle
public FunctionHandle(Sdk sdk, String address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) -
FunctionHandle
public FunctionHandle(Class<RETURN> clazz, Sdk sdk, String address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Creates an instance of aFunctionHandlerecord class.- Parameters:
clazz- the value for theclazzrecord componentsdk- the value for thesdkrecord componentaddress- the value for theaddressrecord componentabi- the value for theabirecord componentcredentials- the value for thecredentialsrecord componentfunctionName- the value for thefunctionNamerecord componentfunctionInputs- the value for thefunctionInputsrecord componentfunctionHeader- the value for thefunctionHeaderrecord component
-
-
Method Details
-
withSdk
-
withCredentials
-
withFunctionInputs
-
withFunctionHeader
public FunctionHandle<RETURN> withFunctionHeader(tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) -
withReturnClass
-
toCallSet
public tech.deplant.java4ever.binding.Abi.CallSet toCallSet() throws tech.deplant.java4ever.binding.EverSdkException- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
toOutput
public RETURN toOutput(Map<String, Object> outputMap) throws tech.deplant.java4ever.binding.EverSdkException- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
toPayload
Encodes internal message string. Result of this method can be used as a payload for internal transactions to pass function calls and inputs with transfer.- Returns:
- TvmCell of the internal call payload
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
toSigner
public tech.deplant.java4ever.binding.Abi.Signer toSigner() -
getAsMap
Encodes inputs and run getter method on account's boc then decodes answer. Important! This method always downloads new boc before running getter on it. If you need to cache boc and run multiple getters cheaply, you need to get Account object via OwnedContract.account() method and then run Account.runGetter() method.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
get
Encodes inputs and run getter method on account's boc then decodes answer. Important! This method always downloads new boc before running getter on it. If you need to cache boc and run multiple getters cheaply, you need to get Account object via OwnedContract.account() method and then run Account.runGetter() method.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
getLocal
Encodes inputs and run getter method on account's boc then decodes answer. Important! This method uses provided boc! There's no guarantee that it corresponds to current blockchain state.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
getLocalAsMap
public Map<String,Object> getLocalAsMap(String boc) throws tech.deplant.java4ever.binding.EverSdkException Encodes inputs and runs getter method on account's boc then decodes answer. Important! When you run getter locally, directly on Account boc, there's no guarantee that it corresponds to current blockchain state.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
callLocalAsMap
public Map<String,Object> callLocalAsMap(String boc, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options, boolean unlimitedBalance) throws tech.deplant.java4ever.binding.EverSdkException Encodes inputs and runs external call method on account's boc then decodes answer. Important! When you run external call locally, directly on Account boc, your blockchain real info remains unchanged.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
callLocal
public RETURN callLocal(String boc, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options, boolean unlimitedBalance) throws tech.deplant.java4ever.binding.EverSdkException Calls smart contract with external message using credentials provided on initialization.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
callAsMap
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
call
Calls smart contract with external message using credentials provided on initialization.- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
callTreeAsMap
public ResultOfTree<Map<String,Object>> callTreeAsMap(boolean throwOnTreeError, List<ContractAbi> otherAbisForDecode) throws tech.deplant.java4ever.binding.EverSdkException As with call(), this method send ext message to Everscale but callTree() also queries message tree with "net.query_transaction_tree" returns a set of messages and transactions, logs everything and throws exceptions on errors encountered in a tree.- Parameters:
throwOnTreeError- If 'true' method will throw on any internal non-0 exit_code encountered in tree.otherAbisForDecode- Method will try to decode each message against ABIs in this list. ABI of entering contract already included.- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
callTree
public ResultOfTree<RETURN> callTree(boolean throwOnTreeError, List<ContractAbi> otherAbisForDecode) throws tech.deplant.java4ever.binding.EverSdkException As with call(), this method send ext message to Everscale but callTree() also queries message tree with "net.query_transaction_tree" returns a set of messages and transactions, logs everything and throws exceptions on errors encountered in a tree.- Parameters:
throwOnTreeError- If 'true' method will throw on any internal non-0 exit_code encountered in tree.otherAbisForDecode- Method will try to decode each message against ABIs in this list. ABI of entering contract already included.- Returns:
- Throws:
tech.deplant.java4ever.binding.EverSdkException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
clazz
Returns the value of theclazzrecord component.- Returns:
- the value of the
clazzrecord component
-
sdk
Returns the value of thesdkrecord component.- Returns:
- the value of the
sdkrecord component
-
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
abi
Returns the value of theabirecord component.- Returns:
- the value of the
abirecord component
-
credentials
Returns the value of thecredentialsrecord component.- Returns:
- the value of the
credentialsrecord component
-
functionName
Returns the value of thefunctionNamerecord component.- Returns:
- the value of the
functionNamerecord component
-
functionInputs
Returns the value of thefunctionInputsrecord component.- Returns:
- the value of the
functionInputsrecord component
-
functionHeader
public tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader()Returns the value of thefunctionHeaderrecord component.- Returns:
- the value of the
functionHeaderrecord component
-