java.lang.Object
tech.deplant.java4ever.binding.Debot
debot
Contains methods of "debot" module.
UNSTABLE(UNSTABLE.md) Module for working with debot.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
static interface
static final record
static final record
static final record
static final record
static final record
static final record
static final record
static interface
static final record
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
execute
(Context ctx, Integer debotHandle, Debot.DebotAction action) debot.execute UNSTABLE(UNSTABLE.md) Executes debot action.static Debot.ResultOfFetch
debot.fetch UNSTABLE(UNSTABLE.md) Fetches DeBot metadata from blockchain.static Debot.RegisteredDebot
init
(Context ctx, String address, AppDebotBrowser appObject) debot.init UNSTABLE(UNSTABLE.md) Creates and instance of DeBot.static void
debot.remove UNSTABLE(UNSTABLE.md) Destroys debot handle.static void
debot.send UNSTABLE(UNSTABLE.md) Sends message to Debot.static void
debot.start UNSTABLE(UNSTABLE.md) Starts the 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 addressappObject
-- Returns:
Debot.RegisteredDebot
- Throws:
EverSdkException
-
start
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
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
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
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
-