Class Debot

java.lang.Object
tech.deplant.java4ever.binding.Debot

public class Debot extends Object
debot Contains methods of "debot" module. UNSTABLE(UNSTABLE.md) Module for working with debot.
  • Constructor Details

    • Debot

      public Debot()
  • Method Details

    • init

      public static Debot.RegisteredDebot init(Context ctx, String address, AppDebotBrowser appObject) throws EverSdkException
      debot.init UNSTABLE(UNSTABLE.md) Creates and instance of DeBot. Downloads debot smart contract (code and data) from blockchain and createsan instance of Debot Engine for it.

      # RemarksIt does not switch debot to context 0. Browser Callbacks are not called.

      Parameters:
      address - Debot smart contract address
      appObject -
      Returns:
      Debot.RegisteredDebot
      Throws:
      EverSdkException
    • start

      public static void start(Context ctx, Integer debotHandle) throws EverSdkException
      debot.start UNSTABLE(UNSTABLE.md) Starts the DeBot. Downloads debot smart contract from blockchain and switches it tocontext zero.

      This function must be used by Debot Browser to start a dialog with debot.While the function is executing, several Browser Callbacks can be called,since the debot tries to display all actions from the context 0 to the user.

      When the debot starts SDK registers `BrowserCallbacks` AppObject.Therefore when `debote.remove` is called the debot is being deleted and the callback is calledwith `finish`=`true` which indicates that it will never be used again.

      Parameters:
      debotHandle - Debot handle which references an instance of debot engine.
      Throws:
      EverSdkException
    • fetch

      public static Debot.ResultOfFetch fetch(Context ctx, String address) throws EverSdkException
      debot.fetch UNSTABLE(UNSTABLE.md) Fetches DeBot metadata from blockchain. Downloads DeBot from blockchain and creates and fetches its metadata.
      Parameters:
      address - Debot smart contract address.
      Returns:
      Debot.ResultOfFetch
      Throws:
      EverSdkException
    • execute

      public static void execute(Context ctx, Integer debotHandle, Debot.DebotAction action) throws EverSdkException
      debot.execute UNSTABLE(UNSTABLE.md) Executes debot action. Calls debot engine referenced by debot handle to execute input action.Calls Debot Browser Callbacks if needed.

      # RemarksChain of actions can be executed if input action generates a list of subactions.

      Parameters:
      debotHandle - Debot handle which references an instance of debot engine.
      action - Debot Action that must be executed.
      Throws:
      EverSdkException
    • send

      public static void send(Context ctx, Integer debotHandle, String message) throws EverSdkException
      debot.send UNSTABLE(UNSTABLE.md) Sends message to Debot. Used by Debot Browser to send response on Dinterface call or from other Debots.
      Parameters:
      debotHandle - Debot handle which references an instance of debot engine.
      message - BOC of internal message to debot encoded in base64 format.
      Throws:
      EverSdkException
    • remove

      public static void remove(Context ctx, Integer debotHandle) throws EverSdkException
      debot.remove UNSTABLE(UNSTABLE.md) Destroys debot handle. Removes handle from Client Context and drops debot engine referenced by that handle.
      Parameters:
      debotHandle - Debot handle which references an instance of debot engine.
      Throws:
      EverSdkException