Class ContractCallLocalQuery.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<ContractCallLocalQuery,ContractCallLocalQuery.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<ContractCallLocalQuery,ContractCallLocalQuery.Builder>
com.hedera.hashgraph.sdk.proto.ContractCallLocalQuery.Builder
All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, ContractCallLocalQueryOrBuilder, Cloneable
Enclosing class:
ContractCallLocalQuery

public static final class ContractCallLocalQuery.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<ContractCallLocalQuery,ContractCallLocalQuery.Builder> implements ContractCallLocalQueryOrBuilder
 *
 Call a view function of a given smart contract<br/>
 The call must provide function parameter inputs as needed.<br/>
 This is potentially useful for calling view functions that will not revert
 when executed in a static EVM context. Many such use cases will be better
 served by using a Mirror Node API, however.

 This is performed locally on the particular node that the client is
 communicating with. Executing the call locally is faster and less costly,
 but imposes certain restrictions.<br/>
 The call MUST NOT change the state of the contract instance. This also
 precludes any expenditure or transfer of HBAR or other tokens.<br/>
 The call SHALL NOT have a separate consensus timestamp.<br/>
 The call SHALL NOT generate a record nor a receipt.<br/>
 The response SHALL contain the output returned by the function call.<br/>
 Any contract call that would use the `STATICCALL` opcode MAY be called via
 contract call local with performance and cost benefits.

 Unlike a ContractCall transaction, the node SHALL always consume the
 _entire_ amount of offered "gas" in determining the fee for this query, so
 accurate gas estimation is important.
 
Protobuf type proto.ContractCallLocalQuery
  • Method Details

    • hasHeader

      public boolean hasHeader()
       *
       Standard information sent with every query operation.<br/>
       This includes the signed payment and what kind of response is requested
       (cost, state proof, both, or neither).
       <p>
       The payment MUST be sufficient for the base fees _and_ the full amount
       in the `gas` field.
       
      .proto.QueryHeader header = 1;
      Specified by:
      hasHeader in interface ContractCallLocalQueryOrBuilder
      Returns:
      Whether the header field is set.
    • getHeader

      public QueryHeader getHeader()
       *
       Standard information sent with every query operation.<br/>
       This includes the signed payment and what kind of response is requested
       (cost, state proof, both, or neither).
       <p>
       The payment MUST be sufficient for the base fees _and_ the full amount
       in the `gas` field.
       
      .proto.QueryHeader header = 1;
      Specified by:
      getHeader in interface ContractCallLocalQueryOrBuilder
      Returns:
      The header.
    • setHeader

      public ContractCallLocalQuery.Builder setHeader(QueryHeader value)
       *
       Standard information sent with every query operation.<br/>
       This includes the signed payment and what kind of response is requested
       (cost, state proof, both, or neither).
       <p>
       The payment MUST be sufficient for the base fees _and_ the full amount
       in the `gas` field.
       
      .proto.QueryHeader header = 1;
    • setHeader

      public ContractCallLocalQuery.Builder setHeader(QueryHeader.Builder builderForValue)
       *
       Standard information sent with every query operation.<br/>
       This includes the signed payment and what kind of response is requested
       (cost, state proof, both, or neither).
       <p>
       The payment MUST be sufficient for the base fees _and_ the full amount
       in the `gas` field.
       
      .proto.QueryHeader header = 1;
    • mergeHeader

      public ContractCallLocalQuery.Builder mergeHeader(QueryHeader value)
       *
       Standard information sent with every query operation.<br/>
       This includes the signed payment and what kind of response is requested
       (cost, state proof, both, or neither).
       <p>
       The payment MUST be sufficient for the base fees _and_ the full amount
       in the `gas` field.
       
      .proto.QueryHeader header = 1;
    • clearHeader

      public ContractCallLocalQuery.Builder clearHeader()
       *
       Standard information sent with every query operation.<br/>
       This includes the signed payment and what kind of response is requested
       (cost, state proof, both, or neither).
       <p>
       The payment MUST be sufficient for the base fees _and_ the full amount
       in the `gas` field.
       
      .proto.QueryHeader header = 1;
    • hasContractID

      public boolean hasContractID()
       *
       The ID of a smart contract to call.
       
      .proto.ContractID contractID = 2;
      Specified by:
      hasContractID in interface ContractCallLocalQueryOrBuilder
      Returns:
      Whether the contractID field is set.
    • getContractID

      public ContractID getContractID()
       *
       The ID of a smart contract to call.
       
      .proto.ContractID contractID = 2;
      Specified by:
      getContractID in interface ContractCallLocalQueryOrBuilder
      Returns:
      The contractID.
    • setContractID

      public ContractCallLocalQuery.Builder setContractID(ContractID value)
       *
       The ID of a smart contract to call.
       
      .proto.ContractID contractID = 2;
    • setContractID

      public ContractCallLocalQuery.Builder setContractID(ContractID.Builder builderForValue)
       *
       The ID of a smart contract to call.
       
      .proto.ContractID contractID = 2;
    • mergeContractID

      public ContractCallLocalQuery.Builder mergeContractID(ContractID value)
       *
       The ID of a smart contract to call.
       
      .proto.ContractID contractID = 2;
    • clearContractID

      public ContractCallLocalQuery.Builder clearContractID()
       *
       The ID of a smart contract to call.
       
      .proto.ContractID contractID = 2;
    • getGas

      public long getGas()
       *
       The amount of "gas" to use for this call.
       <p>
       This transaction SHALL consume all of the gas offered and charge the
       corresponding fee according to the current exchange rate between
       HBAR and "gas".
       
      int64 gas = 3;
      Specified by:
      getGas in interface ContractCallLocalQueryOrBuilder
      Returns:
      The gas.
    • setGas

      public ContractCallLocalQuery.Builder setGas(long value)
       *
       The amount of "gas" to use for this call.
       <p>
       This transaction SHALL consume all of the gas offered and charge the
       corresponding fee according to the current exchange rate between
       HBAR and "gas".
       
      int64 gas = 3;
      Parameters:
      value - The gas to set.
      Returns:
      This builder for chaining.
    • clearGas

      public ContractCallLocalQuery.Builder clearGas()
       *
       The amount of "gas" to use for this call.
       <p>
       This transaction SHALL consume all of the gas offered and charge the
       corresponding fee according to the current exchange rate between
       HBAR and "gas".
       
      int64 gas = 3;
      Returns:
      This builder for chaining.
    • getFunctionParameters

      public com.google.protobuf.ByteString getFunctionParameters()
       *
       The smart contract function to call, and the parameters to pass to that
       function.
       <p>
       These SHALL be presented in EVM bytecode function call format.
       
      bytes functionParameters = 4;
      Specified by:
      getFunctionParameters in interface ContractCallLocalQueryOrBuilder
      Returns:
      The functionParameters.
    • setFunctionParameters

      public ContractCallLocalQuery.Builder setFunctionParameters(com.google.protobuf.ByteString value)
       *
       The smart contract function to call, and the parameters to pass to that
       function.
       <p>
       These SHALL be presented in EVM bytecode function call format.
       
      bytes functionParameters = 4;
      Parameters:
      value - The functionParameters to set.
      Returns:
      This builder for chaining.
    • clearFunctionParameters

      public ContractCallLocalQuery.Builder clearFunctionParameters()
       *
       The smart contract function to call, and the parameters to pass to that
       function.
       <p>
       These SHALL be presented in EVM bytecode function call format.
       
      bytes functionParameters = 4;
      Returns:
      This builder for chaining.
    • getMaxResultSize

      @Deprecated public long getMaxResultSize()
      Deprecated.
      proto.ContractCallLocalQuery.maxResultSize is deprecated. See contract_call_local.proto;l=88
       *
       Do not use this field; it is ignored in the current software.
       <p>
       The maximum number of bytes that the result might include.<br/>
       The call will fail if it would have returned more than this number
       of bytes.
       
      int64 maxResultSize = 5 [deprecated = true];
      Specified by:
      getMaxResultSize in interface ContractCallLocalQueryOrBuilder
      Returns:
      The maxResultSize.
    • setMaxResultSize

      @Deprecated public ContractCallLocalQuery.Builder setMaxResultSize(long value)
      Deprecated.
      proto.ContractCallLocalQuery.maxResultSize is deprecated. See contract_call_local.proto;l=88
       *
       Do not use this field; it is ignored in the current software.
       <p>
       The maximum number of bytes that the result might include.<br/>
       The call will fail if it would have returned more than this number
       of bytes.
       
      int64 maxResultSize = 5 [deprecated = true];
      Parameters:
      value - The maxResultSize to set.
      Returns:
      This builder for chaining.
    • clearMaxResultSize

      @Deprecated public ContractCallLocalQuery.Builder clearMaxResultSize()
      Deprecated.
      proto.ContractCallLocalQuery.maxResultSize is deprecated. See contract_call_local.proto;l=88
       *
       Do not use this field; it is ignored in the current software.
       <p>
       The maximum number of bytes that the result might include.<br/>
       The call will fail if it would have returned more than this number
       of bytes.
       
      int64 maxResultSize = 5 [deprecated = true];
      Returns:
      This builder for chaining.
    • hasSenderId

      public boolean hasSenderId()
       *
       The account that is the "sender" for this contract call.
       <p>
       If this is not set it SHALL be interpreted as the accountId from the
       associated transactionId.<br/>
       If this is set then either the associated transaction or the foreign
       transaction data MUST be signed by the referenced account.
       
      .proto.AccountID sender_id = 6;
      Specified by:
      hasSenderId in interface ContractCallLocalQueryOrBuilder
      Returns:
      Whether the senderId field is set.
    • getSenderId

      public AccountID getSenderId()
       *
       The account that is the "sender" for this contract call.
       <p>
       If this is not set it SHALL be interpreted as the accountId from the
       associated transactionId.<br/>
       If this is set then either the associated transaction or the foreign
       transaction data MUST be signed by the referenced account.
       
      .proto.AccountID sender_id = 6;
      Specified by:
      getSenderId in interface ContractCallLocalQueryOrBuilder
      Returns:
      The senderId.
    • setSenderId

      public ContractCallLocalQuery.Builder setSenderId(AccountID value)
       *
       The account that is the "sender" for this contract call.
       <p>
       If this is not set it SHALL be interpreted as the accountId from the
       associated transactionId.<br/>
       If this is set then either the associated transaction or the foreign
       transaction data MUST be signed by the referenced account.
       
      .proto.AccountID sender_id = 6;
    • setSenderId

      public ContractCallLocalQuery.Builder setSenderId(AccountID.Builder builderForValue)
       *
       The account that is the "sender" for this contract call.
       <p>
       If this is not set it SHALL be interpreted as the accountId from the
       associated transactionId.<br/>
       If this is set then either the associated transaction or the foreign
       transaction data MUST be signed by the referenced account.
       
      .proto.AccountID sender_id = 6;
    • mergeSenderId

      public ContractCallLocalQuery.Builder mergeSenderId(AccountID value)
       *
       The account that is the "sender" for this contract call.
       <p>
       If this is not set it SHALL be interpreted as the accountId from the
       associated transactionId.<br/>
       If this is set then either the associated transaction or the foreign
       transaction data MUST be signed by the referenced account.
       
      .proto.AccountID sender_id = 6;
    • clearSenderId

      public ContractCallLocalQuery.Builder clearSenderId()
       *
       The account that is the "sender" for this contract call.
       <p>
       If this is not set it SHALL be interpreted as the accountId from the
       associated transactionId.<br/>
       If this is set then either the associated transaction or the foreign
       transaction data MUST be signed by the referenced account.
       
      .proto.AccountID sender_id = 6;