Record Class FunctionHandle<RETURN>

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

public record FunctionHandle<RETURN>(Class<RETURN> clazz, Sdk sdk, String address, ContractAbi abi, Credentials credentials, String functionName, Map<String,Object> functionInputs, tech.deplant.java4ever.binding.Abi.FunctionHeader functionHeader) extends Record
  • 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 a FunctionHandle record class.
      Parameters:
      clazz - the value for the clazz record component
      sdk - the value for the sdk record component
      address - the value for the address record component
      abi - the value for the abi record component
      credentials - the value for the credentials 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
  • Method Details

    • withSdk

      public FunctionHandle<RETURN> withSdk(Sdk sdk)
    • 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(Map<String,Object> 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 Map<String,Object> 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 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

      public Map<String,Object> 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<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

      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
    • sdk

      public Sdk sdk()
      Returns the value of the sdk record component.
      Returns:
      the value of the sdk record component
    • address

      public String address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • abi

      public ContractAbi abi()
      Returns the value of the abi record component.
      Returns:
      the value of the abi record component
    • credentials

      public Credentials credentials()
      Returns the value of the credentials record component.
      Returns:
      the value of the credentials 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