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, Contract contract, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) FunctionHandle(Class<RETURN> clazz, Contract contract, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, DebugOptions debugOptions) Creates an instance of aFunctionHandlerecord class.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) 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 TypeMethodDescriptioncall()Calls smart contract with external message using credentials provided on initialization.com.fasterxml.jackson.databind.JsonNodecallLocal(String boc, tech.deplant.java4ever.binding.Tvm.ExecutionOptions options, boolean unlimitedBalance) Calls smart contract with external message using credentials provided on initialization.com.fasterxml.jackson.databind.JsonNodecallLocalAsMap(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, 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.ResultOfTree<com.fasterxml.jackson.databind.JsonNode>callTreeAsMap(boolean throwOnTreeError, 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.contract()Returns the value of thecontractrecord component.Returns the value of thedebugOptionsrecord 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.com.fasterxml.jackson.databind.JsonNodegetAsMap()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.com.fasterxml.jackson.databind.JsonNodegetLocalAsMap(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.sendFrom(MultisigWallet sender, BigInteger value) sendFrom(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag) com.fasterxml.jackson.databind.JsonNodesendFromAsMap(MultisigWallet sender, BigInteger value) com.fasterxml.jackson.databind.JsonNodesendFromAsMap(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag) sendFromTree(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) ResultOfTree<com.fasterxml.jackson.databind.JsonNode>sendFromTreeAsMap(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) tech.deplant.java4ever.binding.Abi.CallSettoOutput(com.fasterxml.jackson.databind.JsonNode outputMap) Encodes internal message string.tech.deplant.java4ever.binding.Abi.SignertoSigner()final StringtoString()Returns a string representation of this record class.withCredentials(Credentials credentials) withDebugTree(boolean enabled, long timeout, boolean throwErrors, ContractAbi... treeAbis) withDebugTree(DebugOptions debugOptions) withFunctionHeader(tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) withFunctionInputs(Map<String, Object> functionInputs) <T> FunctionHandle<T>withReturnClass(Class<T> returnClass)
-
Constructor Details
-
FunctionHandle
-
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) -
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, Contract contract, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, DebugOptions debugOptions) Creates an instance of aFunctionHandlerecord class.- Parameters:
clazz- the value for theclazzrecord componentcontract- the value for thecontractrecord componentfunctionName- the value for thefunctionNamerecord componentfunctionInputs- the value for thefunctionInputsrecord componentfunctionHeader- the value for thefunctionHeaderrecord componentdebugOptions- the value for thedebugOptionsrecord component
-
-
Method Details
-
withDebugTree
public FunctionHandle<RETURN> withDebugTree(boolean enabled, long timeout, boolean throwErrors, ContractAbi... treeAbis) -
withDebugTree
-
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(com.fasterxml.jackson.databind.JsonNode 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
public com.fasterxml.jackson.databind.JsonNode getAsMap() throws tech.deplant.java4ever.binding.EverSdkExceptionEncodes 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 com.fasterxml.jackson.databind.JsonNode 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 com.fasterxml.jackson.databind.JsonNode 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
public com.fasterxml.jackson.databind.JsonNode callAsMap() throws tech.deplant.java4ever.binding.EverSdkException- 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<com.fasterxml.jackson.databind.JsonNode> callTreeAsMap(boolean throwOnTreeError, 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, 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
-
sendFromAsMap
public com.fasterxml.jackson.databind.JsonNode sendFromAsMap(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag) throws tech.deplant.java4ever.binding.EverSdkException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
tech.deplant.java4ever.binding.EverSdkExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
sendFromAsMap
public com.fasterxml.jackson.databind.JsonNode sendFromAsMap(MultisigWallet sender, BigInteger value) throws tech.deplant.java4ever.binding.EverSdkException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
tech.deplant.java4ever.binding.EverSdkExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
sendFrom
public RETURN sendFrom(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag) throws tech.deplant.java4ever.binding.EverSdkException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
tech.deplant.java4ever.binding.EverSdkExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
sendFrom
public RETURN sendFrom(MultisigWallet sender, BigInteger value) throws tech.deplant.java4ever.binding.EverSdkException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
tech.deplant.java4ever.binding.EverSdkExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
sendFromTreeAsMap
public ResultOfTree<com.fasterxml.jackson.databind.JsonNode> sendFromTreeAsMap(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) throws tech.deplant.java4ever.binding.EverSdkException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
tech.deplant.java4ever.binding.EverSdkExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
sendFromTree
public ResultOfTree<RETURN> sendFromTree(MultisigWallet sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) throws tech.deplant.java4ever.binding.EverSdkException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
tech.deplant.java4ever.binding.EverSdkExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
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
-
contract
Returns the value of thecontractrecord component.- Returns:
- the value of the
contractrecord 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
-
debugOptions
Returns the value of thedebugOptionsrecord component.- Returns:
- the value of the
debugOptionsrecord component
-