diff --git a/book/src/concepts/what-is-a-transaction.md b/book/src/concepts/what-is-a-transaction.md index 040ab9a..1478693 100644 --- a/book/src/concepts/what-is-a-transaction.md +++ b/book/src/concepts/what-is-a-transaction.md @@ -24,7 +24,7 @@ Transactions consist of: - a sender - the [account](./what-is-an-account.md) that _signs_ the transaction; - a list (or a chain) of commands - the operations to be executed; -- command inputs - the arguments for the commands: either `pure` - simple* values like numbers or +- command inputs - the arguments for the commands: either `pure` - simple values like numbers or strings, or `object` - objects that the transaction will access; - a gas object - the `Coin` object used to pay for the transaction; - gas price and budget - the cost of the transaction; @@ -33,6 +33,27 @@ Transactions consist of: MoveVM as transaction inputs. They always need to be instantiated/created inside MoveVM. There are only some exceptions to this such as: `ID` and `String` +## Inputs + +Transaction inputs are the arguments for the transaction and are split between 2 types: +- Pure arguments: These are mostly [primitive types](../move-basics/primitive-types.html) with some +extra additions. A pure argument can be: + - boolean + - integer (u8, u16, u32, u64, u128, u256) + - address + - std::ascii::String + - std::string::String + - vector of the above types + - Option of the above types + - ID, a special type that refers to a unique identifier of an object +- Object arguments: These are objects or references of objects that the transaction will access. An +object argument needs to be either a shared object, a frozen object, or an object that the +transaction sender owns, in order for the transaction to be successfull. +For more see [Object Model](http://localhost:3000/object/index.html). + +Note that a single command inside a transaction can also have a previous command's result as input. +These results/inputs can be anything from a simple value, an object, or any kind of Move struct. + ## Commands Sui transactions may consist of multiple commands. Each command is a single built-in command (like diff --git a/book/src/programmability/bcs.md b/book/src/programmability/bcs.md index afcce4b..671ab9d 100644 --- a/book/src/programmability/bcs.md +++ b/book/src/programmability/bcs.md @@ -52,7 +52,9 @@ Structs encode similarly to simple types. Here is how to encode a struct using B {{#include ../../../packages/samples/sources/programmability/bcs.move:encode_struct}} ``` -Note that encoding a struct does not make much sense in interacting with the Move VM, as custom structs cannot be created this way to use in MoveVM. See also [Transaction](../concepts/what-is-a-transaction.html). +Note that encoding a custom struct does not make much sense in interacting with the Move VM, as +custom structs cannot be created this way to use in MoveVM. See also +[Transaction Inputs](../concepts/what-is-a-transaction.html#inputs). ## Decoding