Record Class FunctionHandle<RETURN>

java.lang.Object
java.lang.Record
tech.deplant.java4ever.framework.FunctionHandle<RETURN>

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
  • Constructor Details

    • FunctionHandle

      public FunctionHandle(Class<RETURN> clazz, Contract contract, 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)
    • 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 a FunctionHandle record class.
      Parameters:
      clazz - the value for the clazz record component
      contract - the value for the contract record component
      functionName - the value for the functionName record component
      functionInputs - the value for the functionInputs record component
      functionHeader - the value for the functionHeader record component
      debugOptions - the value for the debugOptions record component
  • Method Details

    • withDebugTree

      public FunctionHandle<RETURN> withDebugTree(boolean enabled, long timeout, boolean throwErrors, ContractAbi... treeAbis)
    • withDebugTree

      public FunctionHandle<RETURN> withDebugTree(DebugOptions debugOptions)
    • withCredentials

      public FunctionHandle<RETURN> withCredentials(Credentials credentials)
    • withFunctionInputs

      public FunctionHandle<RETURN> withFunctionInputs(Map<String,Object> functionInputs)
    • withFunctionHeader

      public FunctionHandle<RETURN> withFunctionHeader(tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader)
    • withReturnClass

      public <T> FunctionHandle<T> withReturnClass(Class<T> returnClass)
    • 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

      public TvmCell toPayload() throws tech.deplant.java4ever.binding.EverSdkException
      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.EverSdkException
      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

      public RETURN get() throws tech.deplant.java4ever.binding.EverSdkException
      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

      public RETURN getLocal(String boc) throws tech.deplant.java4ever.binding.EverSdkException
      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

      public RETURN call() throws tech.deplant.java4ever.binding.EverSdkException
      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.EverSdkException
      com.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.EverSdkException
      com.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.EverSdkException
      com.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.EverSdkException
      com.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.EverSdkException
      com.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.EverSdkException
      com.fasterxml.jackson.core.JsonProcessingException
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • clazz

      public Class<RETURN> clazz()
      Returns the value of the clazz record component.
      Returns:
      the value of the clazz record component
    • contract

      public Contract contract()
      Returns the value of the contract record component.
      Returns:
      the value of the contract record component
    • functionName

      public String functionName()
      Returns the value of the functionName record component.
      Returns:
      the value of the functionName record component
    • functionInputs

      public Map<String,Object> functionInputs()
      Returns the value of the functionInputs record component.
      Returns:
      the value of the functionInputs record component
    • functionHeader

      public tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader()
      Returns the value of the functionHeader record component.
      Returns:
      the value of the functionHeader record component
    • debugOptions

      public DebugOptions debugOptions()
      Returns the value of the debugOptions record component.
      Returns:
      the value of the debugOptions record component