Class HookCall

java.lang.Object
com.hedera.hashgraph.sdk.HookCall
Direct Known Subclasses:
FungibleHookCall, NftHookCall

public abstract class HookCall extends Object
Specifies a call to a hook from within a transaction.

Often the hook's entity is implied by the nature of the call site. For example, when using an account allowance hook inside a crypto transfer, the hook's entity is necessarily the account whose authorization is required.

For future extension points where the hook owner is not forced by the context, we include the option to fully specify the hook id for the call.

  • Constructor Details

    • HookCall

      protected HookCall(long hookId, EvmHookCall evmHookCall)
      Create a HookCall with a numeric hook ID.
      Parameters:
      hookId - the numeric ID of the hook to call
      evmHookCall - the EVM hook call details
  • Method Details

    • getHookId

      public Long getHookId()
      Get the numeric hook ID.
      Returns:
      the numeric hook ID, or null if using full hook ID
    • getEvmHookCall

      public EvmHookCall getEvmHookCall()
      Get the EVM hook call details.
      Returns:
      the EVM hook call details
    • toProtobuf

      HookCall toProtobuf()
      Convert this HookCall to a protobuf message.
      Returns:
      the protobuf HookCall
    • fromProtobuf

      static HookCall fromProtobuf(HookCall proto)
      Create a HookCall from a protobuf message.
      Parameters:
      proto - the protobuf HookCall
      Returns:
      a new HookCall instance
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object