Actions
Last updated
Last updated
Actions represent the concept of an elementary unit of execution on Sui, such as withdrawing an object or transferring it. Multiple actions can be stacked together to compose an intent that will process each one sequentially.
In the diagram below, you can see the processing flow of an intent composed of four actions. The first action withdraws (receives) an object from the account and returns it. The following action uses it as an input and transfers it to a recipient. The two subsequent actions perform the same operation with another object.
In Move, this is implemented as simple structs with a unique store
ability. Each Action defines its own interface for adding it to an intent, executing it, and deleting it.
Each action type implements three core functions:
New: Creates and adds the action to an intent
Do: Performs the action's operation during intent execution
Delete: Cleans up the action when the intent is destroyed