Module java4ever.framework
Package tech.deplant.java4ever.framework
Record Class FunctionHandle<RETURN>
java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.FunctionHandle<RETURN>
- Type Parameters:
RETURN
- the type parameter
public record FunctionHandle<RETURN>(Class<RETURN> clazz, Contract contract, String functionName, Map<String,Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader, DebugOptions debugOptions)
extends Record
The type Function handle.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFunctionHandle
(int sdk, Address address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Instantiates a new Function handle.FunctionHandle
(Class<RETURN> clazz, int sdk, Address address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Instantiates a new Function handle.FunctionHandle
(Class<RETURN> clazz, Contract contract, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Instantiates a new Function handle.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 aFunctionHandle
record class. -
Method Summary
Modifier and TypeMethodDescriptioncall()
Calls smart contract with external message using credentials provided on initialization.com.fasterxml.jackson.databind.JsonNode
Call as map json node.callLocal
(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.JsonNode
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, 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 theclazz
record component.contract()
Returns the value of thecontract
record component.Returns the value of thedebugOptions
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.com.fasterxml.jackson.databind.JsonNode
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.com.fasterxml.jackson.databind.JsonNode
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.sendFrom
(MultisigContract sender, BigInteger value) Send from return.sendFrom
(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag) Send from return.sendFrom
(MultisigContract2 sender, BigInteger value, boolean bounce, MessageFlag flag) Send from return.com.fasterxml.jackson.databind.JsonNode
sendFromAsMap
(MultisigContract sender, BigInteger value) Send from as map json node.com.fasterxml.jackson.databind.JsonNode
sendFromAsMap
(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag) Send from as map json node.com.fasterxml.jackson.databind.JsonNode
sendFromAsMap
(MultisigContract2 sender, BigInteger value, boolean bounce, MessageFlag flag) Send from as map json node.sendFromTree
(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) Send from tree result of tree.ResultOfTree
<com.fasterxml.jackson.databind.JsonNode> sendFromTreeAsMap
(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) Send from tree as map result of tree.To builder builder.tech.deplant.java4ever.binding.Abi.CallSet
To call set abi . call set.toOutput
(com.fasterxml.jackson.databind.JsonNode outputMap) To output return.Encodes internal message string.tech.deplant.java4ever.binding.Abi.Signer
toSigner()
To signer abi . signer.final String
toString()
Returns a string representation of this record class.withCredentials
(Credentials credentials) With credentials function handle.withDebugTree
(boolean enabled, long timeout, boolean throwErrors, long transactionMaxCount, ContractAbi... treeAbis) With debug tree function handle.withDebugTree
(DebugOptions debugOptions) With debug tree function handle.withFunctionHeader
(tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) With function header function handle.withFunctionInputs
(Map<String, Object> functionInputs) With function inputs function handle.<T> FunctionHandle
<T> withReturnClass
(Class<T> returnClass) With return class function handle.
-
Constructor Details
-
FunctionHandle
public FunctionHandle(Class<RETURN> clazz, Contract contract, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Instantiates a new Function handle.- Parameters:
clazz
- the clazzcontract
- the contractfunctionName
- the function namefunctionInputs
- the function inputsfunctionHeader
- the function header
-
FunctionHandle
public FunctionHandle(Class<RETURN> clazz, int sdk, Address address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Instantiates a new Function handle.- Parameters:
clazz
- the clazzsdk
- the sdkaddress
- the addressabi
- the abicredentials
- the credentialsfunctionName
- the function namefunctionInputs
- the function inputsfunctionHeader
- the function header
-
FunctionHandle
public FunctionHandle(int sdk, Address address, ContractAbi abi, Credentials credentials, String functionName, Map<String, Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) Instantiates a new Function handle.- Parameters:
sdk
- the sdkaddress
- the addressabi
- the abicredentials
- the credentialsfunctionName
- the function namefunctionInputs
- the function inputsfunctionHeader
- the function header
-
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 aFunctionHandle
record class.- Parameters:
clazz
- the value for theclazz
record componentcontract
- the value for thecontract
record componentfunctionName
- the value for thefunctionName
record componentfunctionInputs
- the value for thefunctionInputs
record componentfunctionHeader
- the value for thefunctionHeader
record componentdebugOptions
- the value for thedebugOptions
record component
-
-
Method Details
-
withDebugTree
public FunctionHandle<RETURN> withDebugTree(boolean enabled, long timeout, boolean throwErrors, long transactionMaxCount, ContractAbi... treeAbis) With debug tree function handle.- Parameters:
enabled
- the enabledtimeout
- the timeoutthrowErrors
- the throw errorstransactionMaxCount
- the transaction max counttreeAbis
- the tree abis- Returns:
- the function handle
-
withDebugTree
With debug tree function handle.- Parameters:
debugOptions
- the debug options- Returns:
- the function handle
-
withCredentials
With credentials function handle.- Parameters:
credentials
- the credentials- Returns:
- the function handle
-
withFunctionInputs
With function inputs function handle.- Parameters:
functionInputs
- the function inputs- Returns:
- the function handle
-
withFunctionHeader
public FunctionHandle<RETURN> withFunctionHeader(tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) With function header function handle.- Parameters:
functionHeader
- the function header- Returns:
- the function handle
-
withReturnClass
With return class function handle.- Type Parameters:
T
- the type parameter- Parameters:
returnClass
- the return class- Returns:
- the function handle
-
toCallSet
public tech.deplant.java4ever.binding.Abi.CallSet toCallSet() throws tech.deplant.java4ever.binding.EverSdkExceptionTo call set abi . call set.- Returns:
- the abi . call set
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
toOutput
public RETURN toOutput(com.fasterxml.jackson.databind.JsonNode outputMap) throws tech.deplant.java4ever.binding.EverSdkException To output return.- Parameters:
outputMap
- the output map- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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
- the ever sdk exception
-
toSigner
public tech.deplant.java4ever.binding.Abi.Signer toSigner()To signer abi . signer.- Returns:
- the abi . signer
-
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.- Returns:
- the as map
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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.- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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.- Parameters:
boc
- the boc- Returns:
- the local
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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.- Parameters:
boc
- the boc- Returns:
- the local as map
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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.- Parameters:
boc
- the bocoptions
- the optionsunlimitedBalance
- the unlimited balance- Returns:
- the json node
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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.- Parameters:
boc
- the bocoptions
- the optionsunlimitedBalance
- the unlimited balance- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
callAsMap
public com.fasterxml.jackson.databind.JsonNode callAsMap() throws tech.deplant.java4ever.binding.EverSdkExceptionCall as map json node.- Returns:
- the json node
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
call
Calls smart contract with external message using credentials provided on initialization.- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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:
- result of tree
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
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:
- result of tree
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFromAsMap
public com.fasterxml.jackson.databind.JsonNode sendFromAsMap(MultisigContract2 sender, BigInteger value, boolean bounce, MessageFlag flag) throws tech.deplant.java4ever.binding.EverSdkException Send from as map json node.- Parameters:
sender
- the sendervalue
- the valuebounce
- the bounceflag
- the flag- Returns:
- the json node
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFromAsMap
public com.fasterxml.jackson.databind.JsonNode sendFromAsMap(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag) throws tech.deplant.java4ever.binding.EverSdkException Send from as map json node.- Parameters:
sender
- the sendervalue
- the valuebounce
- the bounceflag
- the flag- Returns:
- the json node
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFromAsMap
public com.fasterxml.jackson.databind.JsonNode sendFromAsMap(MultisigContract sender, BigInteger value) throws tech.deplant.java4ever.binding.EverSdkException Send from as map json node.- Parameters:
sender
- the sendervalue
- the value- Returns:
- the json node
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFrom
public RETURN sendFrom(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag) throws tech.deplant.java4ever.binding.EverSdkException Send from return.- Parameters:
sender
- the sendervalue
- the valuebounce
- the bounceflag
- the flag- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFrom
public RETURN sendFrom(MultisigContract2 sender, BigInteger value, boolean bounce, MessageFlag flag) throws tech.deplant.java4ever.binding.EverSdkException Send from return.- Parameters:
sender
- the sendervalue
- the valuebounce
- the bounceflag
- the flag- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFrom
public RETURN sendFrom(MultisigContract sender, BigInteger value) throws tech.deplant.java4ever.binding.EverSdkException Send from return.- Parameters:
sender
- the sendervalue
- the value- Returns:
- the return
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFromTreeAsMap
public ResultOfTree<com.fasterxml.jackson.databind.JsonNode> sendFromTreeAsMap(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) throws tech.deplant.java4ever.binding.EverSdkException Send from tree as map result of tree.- Parameters:
sender
- the sendervalue
- the valuebounce
- the bounceflag
- the flagthrowOnTreeError
- the throw on tree errorotherAbisForDecode
- the other abis for decode- Returns:
- the result of tree
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
sendFromTree
public ResultOfTree<RETURN> sendFromTree(MultisigContract sender, BigInteger value, boolean bounce, MessageFlag flag, boolean throwOnTreeError, ContractAbi... otherAbisForDecode) throws tech.deplant.java4ever.binding.EverSdkException Send from tree result of tree.- Parameters:
sender
- the sendervalue
- the valuebounce
- the bounceflag
- the flagthrowOnTreeError
- the throw on tree errorotherAbisForDecode
- the other abis for decode- Returns:
- the result of tree
- Throws:
tech.deplant.java4ever.binding.EverSdkException
- the ever sdk exception
-
toBuilder
-
toString
-
hashCode
-
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
-
contract
Returns the value of thecontract
record component.- Returns:
- the value of the
contract
record component
-
functionName
Returns the value of thefunctionName
record component.- Returns:
- the value of the
functionName
record component
-
functionInputs
-
functionHeader
public tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader()Returns the value of thefunctionHeader
record component.- Returns:
- the value of the
functionHeader
record component
-
debugOptions
Returns the value of thedebugOptions
record component.- Returns:
- the value of the
debugOptions
record component
-