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 aFunctionHandle
record 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 theabi
record component.address()
Returns the value of theaddress
record 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 theclazz
record component.Returns the value of thecredentials
record component.final boolean
Indicates whether some other object is "equal to" this one.tech.deplant.java4ever.binding.Abi.FunctionHeader
Returns the value of thefunctionHeader
record component.Returns the value of thefunctionInputs
record component.Returns the value of thefunctionName
record 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 int
hashCode()
Returns a hash code value for this object.sdk()
Returns the value of thesdk
record component.tech.deplant.java4ever.binding.Abi.CallSet
Encodes internal message string.tech.deplant.java4ever.binding.Abi.Signer
toSigner()
final String
toString()
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 aFunctionHandle
record class.- Parameters:
clazz
- the value for theclazz
record componentsdk
- the value for thesdk
record componentaddress
- the value for theaddress
record componentabi
- the value for theabi
record componentcredentials
- the value for thecredentials
record componentfunctionName
- the value for thefunctionName
record componentfunctionInputs
- the value for thefunctionInputs
record componentfunctionHeader
- the value for thefunctionHeader
record 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 theclazz
record component.- Returns:
- the value of the
clazz
record component
-
sdk
Returns the value of thesdk
record component.- Returns:
- the value of the
sdk
record component
-
address
Returns the value of theaddress
record component.- Returns:
- the value of the
address
record component
-
abi
Returns the value of theabi
record component.- Returns:
- the value of the
abi
record component
-
credentials
Returns the value of thecredentials
record component.- Returns:
- the value of the
credentials
record component
-
functionName
Returns the value of thefunctionName
record component.- Returns:
- the value of the
functionName
record component
-
functionInputs
Returns the value of thefunctionInputs
record component.- Returns:
- the value of the
functionInputs
record component
-
functionHeader
public tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader()Returns the value of thefunctionHeader
record component.- Returns:
- the value of the
functionHeader
record component
-