Skip to main content

IOTA Client PTB CLI

The client ptb command allows you to specify the transactions for execution in a programmable transaction block (PTB) directly from your CLI or through bash scripts.

Commands

The following list itemizes all the available args for the iota client ptb command. Use the --help for a long help version that includes some examples on how to use this command.

Build, preview, and execute programmable transaction blocks. Depending on your shell, you might have to use quotes around arrays or other passed values. Use --help to see examples for how to use the core functionality of this command.

Usage: iota client ptb [OPTIONS]

Options:
--assign <NAME> <VALUE> Assign a value to a variable name to use later in the PTB.
If only a name is supplied, the result of the last transaction is bound to that name.
If a name and value are supplied, then the name is bound to that value.

Examples:
--assign MYVAR 100
--assign X [100,5000]
--split-coins gas [1000, 5000, 75000]
--assign new_coins # bound new_coins to the result of previous transaction

--dry-run
Perform a dry run of the PTB instead of executing it.
--dev-inspect
Perform a dev inspect of the PTB instead of executing it.

--gas-coin <ID> The object ID of the gas coin to use. If not specified, it will try to use the first gas coin that it finds that has at least the requested gas-budget balance.
--make-move-vec <TYPE> <[VALUES]> Given n-values of the same type, it constructs a vector. For non objects or an empty vector, the type tag must be specified.
--merge-coins <INTO_COIN> <[COIN OBJECTS]> Merge N coins into the provided coin.
--move-call <PACKAGE::MODULE::FUNCTION> <TYPE> <FUNCTION_ARGS> Make a Move call to a function.
--split-coins <COIN> <[AMOUNT]> Split the coin into N coins as per the given array of amounts.
--transfer-objects <[OBJECTS]> <TO> Transfer objects to the specified address.
--publish <MOVE_PACKAGE_PATH> Publish the Move package. It takes as input the folder where the package exists.
--upgrade <MOVE_PACKAGE_PATH> Upgrade the Move package. It takes as input the folder where the package exists.
--preview Preview the list of PTB transactions instead of executing them.
--serialize-unsigned-transaction Instead of executing the transaction, serialize the bcs bytes of the unsigned transaction data using base64 encoding.
--serialize-signed-transaction Instead of executing the transaction, serialize the bcs bytes of the signed transaction data using base64 encoding.
--summary Show only a short summary (digest, execution status, gas cost). Do not use this flag when you need all the transaction data and the execution effects.
--warn-shadows Enable shadow warning when the same variable name is declared multiple times. Off by default.
--json Return command outputs in json format.
-h, --help Print help (see more with '--help')

Design philosophy and concepts

The main philosophy behind the CLI PTB support is to enable a user to build and execute a PTB from the command line. Bash scripts can be used to construct and execute the PTB just as you would do from the command line, providing great flexibility when it comes to automating different tasks.

Besides using existing traditional PTB related concepts, we introduce a few new and important concepts for this command.

warning

All the following examples were tested using a bash shell environment and your experience may vary depending on how your shell interprets the input values (e.g., zsh requires to pass values in brackets by adding quotes around it: "[]"; bash accepts them without quotes).

Types

Sometimes, CLI PTBs require that you specify the type of a value or variable. For instance, in the following example you must provide the <u64> type when calling the 0x1::option::is_none function.

iota client ptb \
--assign my_variable none \
--move-call 0x1::option::is_none "<u64>" my_variable \
--gas-budget 50000000

To pass in multiple types, delimit them with a comma:

...
--move-call package::module::function "<u64,u8,u256>" \
...

Structs and enums can't be directly provided as parameters, as they can only be constructed in the module in which they are declared. One can only call a function that returns one and then provide the result as an argument to another function. Otherwise anyone could create any struct with any values, for example just create new coins out of thin air. For enums, it's limited, so someone can't construct an instance that breaks some internal invariant.

Strings

CLI PTBs support string literals as inputs, which will be encoded as pure values that can be used as inputs to vector<u8>, std::ascii::String and std::string::String parameters. The following example previews a transaction block that passes the string "Hello, world" to a function m::f in a package $PKG (its ID is held in an environment variable).

iota client ptb --move-call "$PKG::m::f" '"Hello, world"' --preview
warning

Double-quoted string literals tend to also be valid syntax for shells (like bash), so when inputting PTBs on the command-line, remember to wrap the entire string in single-quotes so that its double-quotes are interpreted literally, as in the previous example.

Addresses and Object IDs

You can pass literal addresses and objects IDs by prefixing them with '@'. This is needed to distinguish a hexadecimal value from an address in some situations.

For addresses that are in your local wallet, you can use their alias instead (passing them without '@', for example, --transfer-objects my_alias).

Here are some examples for transfer-objects and gas-coin:

iota client ptb --transfer-objects [ARRAY_OF_OBJECTS] @0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331 --gas-coin @0x00002819ee07a66e53800495ccf5eeade8a02054a2e0827546c70e4b226f0495

Assign

Use the --assign argument to bind values to variables. There are two ways you can use it:

  • assign a value to a variable
  • assign a variable to the result of the previous command

Let's look at the first case where you assign a value to a variable. You want to check if some variable's value is none. Call the 0x1::option::is_none function from the Move standard library, and pass in the variable name:

iota client ptb \
--assign my_variable none \
--move-call 0x1::option::is_none "<u64>" my_variable \
--gas-budget 50000000
tip

CLI PTB uses name resolution for common packages like iota, std, so you can use them directly instead of their addresses: 0x2 or 0x1.

In the second case, if a previous command outputs some result, you can bound it to a variable for later access. Let's see an example where you want a new coin with 1000 NANOS, which you can achieve by using the split-coins command. After you do that, you want to transfer the new coin to another address. Without the --assign argument, you couldn't instruct the CLI to transfer that new coin object as you would not have a way to refer to it.

iota client ptb \
--split-coins gas [1000] \
--assign coin \
--transfer-objects [coin] @recipient_address \
--gas-budget 50000000
tip

If you build a complex PTB, use the --preview or --dry-run flags to display the PTB transaction list and effects instead of executing it immediately and wasting gas.

Examples

The following examples demonstrate how to use the client ptb command.

tip

When a PTB is executed, the output contains all the relevant information (transaction data, gas cost, effects, object changes, and so on). Use --summary to get a short summary when you do not need all the data. For complex PTBs, you can use --preview to display the PTB transaction list instead of executing it.

Move call

When needing to execute a Move call, use the --move-call transaction to call a specific function from a package. The CLI PTB supports name resolution for common packages like iota, std, so you can use both 0x1::option::is_none as well as std::option::is_none for passing the function name.

--assign A none
--move-call std::option::is_none "<u64>" A

To call a specific function from a specific package, you can use the following call:

--move-call PACKAGE_ADDR::MODULE::FUNCTION "<TYPE>" FUNC_ARG1 FUNC_ARG2 ...

Publish

Publishing a package is one of the most important commands you need when working with IOTA. While the CLI has a standalone publish command, PTBs also support publishing and upgrading packages. One main difference is that with iota client ptb, you must explicitly transfer the UpgradeCap object that is returned when creating a package, or destroy it with a call to make_immutable. Here is an example on how to publish a Move project (from within its folder, that's why the path is ".") on chain using the iota client ptb command. It makes a call to the iota::tx_context::sender to acquire the sender and assigns the result of that call to the sender variable, and then calls the publish command. The result of publish is bounded to upgrade_cap variable, and then this object is transferred to the sender.

iota client ptb \
--move-call iota::tx_context::sender \
--assign sender \
--publish "." \
--assign upgrade_cap \
--transfer-objects "[upgrade_cap]" sender \
--gas-budget 100000000 \
--dry-run

Upgrade

tip

Before upgrading a package, you need to add published-at = "<PACKAGE_ID>" (with the 0x... package ID) to its Move.toml in the [package] section.

iota client ptb \
--assign upgrade_cap @0x7ccc6c2fe6a509e6266b17e57a109f393f435a30da748c5168448958eb47d826 \
--upgrade "." upgrade_cap \
--gas-budget 100000000 \
--dry-run

Split, destroy, and merge coins

The following example showcases how to split a gas coin into multiple coins, make a Move call to destroy one or more of the new coins, and finally merge the coins that were not destroyed back into the gas coin. It also showcases how to use framework name resolution (for example, iota::coin instead of 0x2::coin) and how to refer to different values in an array using the . syntax.

# Split off from gas
--split-coins gas [0,1,2,3]
--assign coins
--move-call iota::coin::destroy_zero<iota::iota::IOTA> coins.0
# Can further split a split coin (and through variable bindings/result accesses)
--split-coins coins.1 [0,0]
--assign zerocoins
# Destroy both new coins
--move-call iota::coin::destroy_zero<iota::iota::IOTA> zerocoins.0
--move-call iota::coin::destroy_zero<iota::iota::IOTA> zerocoins.1
# Can merge the split coins back. There is no result; the first coin (gas coin in this example) will have all the coins.
--merge-coins gas [coins.1, coins.2, coins.3]
--gas-budget 10000000

The same commands work for coins that are not iota::iota::IOTA. It is just not possible to split them from the gas object, but requires an object ID of the other coin.

iota client ptb \
--assign other_coin_object_id @0xdab43e6be5f1e3b977448f368c9ec3bb6b9ee75e269633c32d3c94f9f094e23c \
--split-coins other_coin_object_id "[0,1,2,3]" \
--assign coins \
--merge-coins other_coin_object_id "[coins.0, coins.1, coins.2, coins.3]" \
--dry-run

Transfer Objects

This example creates three new coins from gas and transfers them to a different address.

--assign to_address @0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331 \
--split-coins gas [1,2,3] \
--assign s \
--transfer-objects [s.0, s.1, s.2] to_address \
--gas-budget 10000000
info

You can also pass an alias for addresses in the keystore (without the '@') instead of an address.

Transfer to multiple addresses:

COIN_TRANSFERS='{
"0x111111111504e9350e635d65cd38ccd2c029434c6a3a480d8947a9ba6a15b215": "1000",
"0xfffff99ac1a34ac3d005780fb7728969e1f1a166c947fe7c5dc4fad060ba35ff": "2000"
}'
# Split into arrays
ADDRESSES=($(echo "$COIN_TRANSFERS" | jq -r 'keys[]'))
AMOUNTS=($(echo "$COIN_TRANSFERS" | jq -r 'to_entries | map(.value) | join(",")'))
# Create the PTB command
ptb_command="iota client ptb \
--split-coins gas [${AMOUNTS[*]}] \
--assign coins"
for i in "${!ADDRESSES[@]}"; do
ptb_command+=" --transfer-objects [coins.$i] @${ADDRESSES[$i]}"
done
ptb_command+="--gas-budget 10000000 \
--dry-run"
# Run the command
$ptb_command

make-move-vec

Create a vector of strings:

iota client ptb \
--make-move-vec "<std::string::String>" "['zero', 'one', 'two']" \
--assign my_string_vec \
--dry-run

Create a vector of addresses:

iota client ptb \
--make-move-vec "<address>" "[@0x392316417a23198afeeb80d9fec314c65162ab5ad18f8a4c3375d31deab29670, @0x111111111504e9350e635d65cd38ccd2c029434c6a3a480d8947a9ba6a15b215]" \
--assign addresses \
--dry-run

Create a vector of vectors with u8 values:

iota client ptb \
--make-move-vec "<u8>" "[0, 1, 2]" \
--assign u8vec \
--make-move-vec "<vector<u8>>" "[u8vec, u8vec]" \
--assign nested_u8_vec \
--dry-run

vec-map

iota client ptb \
--make-move-vec "<std::string::String>" "['key1', 'key2']" \
--assign keys \
--make-move-vec "<std::string::String>" "['value1', 'value2']" \
--assign values \
--move-call 0x2::vec_map::from_keys_values "<std::string::String,std::string::String>" keys values \
--assign data_vec_map \
--move-call 0x2::vec_map::insert "<std::string::String,std::string::String>" data_vec_map '"key3"' '"value3"' \
--move-call 0x2::vec_map::pop "<std::string::String,std::string::String>" data_vec_map \
--move-call 0x2::vec_map::pop "<std::string::String,std::string::String>" data_vec_map \
--move-call 0x2::vec_map::pop "<std::string::String,std::string::String>" data_vec_map \
--move-call 0x2::vec_map::destroy_empty "<std::string::String,std::string::String>" data_vec_map \
--dry-run

Option

iota client ptb \
--assign hello_option "some('Hello')" \
--move-call std::option::is_some "<std::string::String>" hello_option \
--move-call std::option::contains "<std::string::String>" hello_option "'Hello'" \
--move-call std::option::extract "<std::string::String>" hello_option \
--assign hello \
--move-call std::string::append hello "', world'" \
--assign hello_world \
--dry-run
note

Functions that return a reference, such as std::option::borrow, cannot be used in a PTB call but only in a smart contract.

Staking

Stake:

iota client ptb \
--assign validator_address @0x392316417a23198afeeb80d9fec314c65162ab5ad18f8a4c3375d31deab29670 \
--assign stake_amount 1000000000 \
--split-coins gas "[stake_amount]" \
--assign coin \
--move-call 0x3::iota_system::request_add_stake @0x5 coin validator_address \
--gas-budget 50000000

Partially withdraw staked IOTAs (potential rewards are also split and withdrawn additionally to the provided amount):

iota client ptb \
--assign staked_iota @0x08dff8b855cc48c5f4e1911a4b20d4d3805d12443fc824bc263172f0ce68aaaa \
--assign amount_to_withdraw 1000000000 \
--move-call 0x3::staking_pool::split staked_iota amount_to_withdraw \
--assign split_staked_iota \
--move-call 0x3::iota_system::request_withdraw_stake @0x5 split_staked_iota \
--gas-budget 100000000

Mint a Coin

Mint coins with a 0x2::coin::TreasuryCap and transfer them to the sender. Based on the simple_token.move example. The package ID and TreasuryCap object ID need to be replaced to the one for your published package.

iota client ptb \
--assign treasury_cap @0x0a7f7eb7bcbb6446a74892ae40c0eed7fbbedd43da8c41b8ff87141b2c56ef90 \
--move-call iota::tx_context::sender \
--assign sender \
--move-call iota::coin::mint "<0x4a4799fda4e427b68297216614d2b62a8a1903a813ebce9d7770ad99f67317f2::simple_token::SIMPLE_TOKEN>" treasury_cap 100 \
--assign minted_coins \
--transfer-objects "[minted_coins]" sender \
--dry-run

Reserved words

You cannot use the following words for variable names:

  • address
  • bool
  • vector
  • some
  • none
  • gas
  • u8
  • u16
  • u32
  • u64
  • u128
  • u256

JSON output

Append the --json flag to commands to format responses in JSON instead of the more human-friendly default IOTA CLI output. This can be useful for extremely large datasets, for example, as those results can have a troublesome display on smaller screens. In these cases, the --json flag is useful.

dry-run and dev-inspect

Both flags can simulate a transaction block and show its effects without committing it to the blockchain, meaning no gas fees are charged.

A dry-run is ideal for quickly checking whether a transaction will succeed or fail. It's helpful for testing the transaction logic and confirming that the transaction behaves as expected.

A dev-inspect is useful for in-depth analysis and troubleshooting of transaction logic or inspection of on-chain data. dev-inspect enables users to call any Move function with specified arguments, returning outputs and modified inputs without altering the state. Also, results don't need to be handled as usual, references to objects can be returned, and owned objects don't need to be destroyed or transferred. The result for each PTB transaction is printed at the end of the dev-inspect output.

dry-run Example

iota client ptb \ 
--move-call iota::tx_context::sender \
--assign sender \
--split-coins gas "[1000000000]" \
--assign coin \
--transfer-objects "[coin]" sender \
--dry-run
Output:
Dry run completed, execution status: success
╭──────────────────────────────────────────────────────────────────────────────────────╮
│ Dry Run Transaction Data │
├──────────────────────────────────────────────────────────────────────────────────────┤
│ Sender: 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc │
│ Gas Owner: 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc │
│ Gas Budget: 50000000000 NANOS │
│ Gas Price: 1000 NANOS │
│ Gas Payment: │
│ │
│ │
│ Transaction Kind: Programmable │
│ ╭──────────────────────────────────────────────╮ │
│ │ Input Objects │ │
│ ├──────────────────────────────────────────────┤ │
│ │ 0 Pure Arg: Type: u64, Value: "1000000000" │ │
│ ╰──────────────────────────────────────────────╯ │
│ ╭──────────────────────────────────────────────────────────────────────────────────╮ │
│ │ Commands │ │
│ ├──────────────────────────────────────────────────────────────────────────────────┤ │
│ │ 0 MoveCall: │ │
│ │ ┌ │ │
│ │ │ Function: sender │ │
│ │ │ Module: tx_context │ │
│ │ │ Package: 0x0000000000000000000000000000000000000000000000000000000000000002 │ │
│ │ └ │ │
│ │ │ │
│ │ 1 SplitCoins: │ │
│ │ ┌ │ │
│ │ │ Coin: GasCoin │ │
│ │ │ Amounts: │ │
│ │ │ Input 0 │ │
│ │ └ │ │
│ │ │ │
│ │ 2 TransferObjects: │ │
│ │ ┌ │ │
│ │ │ Arguments: │ │
│ │ │ Result 1 │ │
│ │ │ Address: Result 0 │ │
│ │ └ │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────╯ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Transaction Effects │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Digest: DkkfwFB3qqojaKaijocXhWYwHhDysEQEceZpwDBaoBgv │
│ Status: Success │
│ Executed Epoch: 67 │
│ │
│ Created Objects: │
│ ┌── │
│ │ ID: 0x66cb2f98a4cbb9da278e197ec7fe675f9e47b12c13aac731c94f46d29153d425 │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ Version: 2 │
│ │ Digest: Zy4jEt7kaFEjeaFRnbw9BRSo8CJibJXD2JtLeVe3duc │
│ └── │
│ Mutated Objects: │
│ ┌── │
│ │ ID: 0xc5ea5446fdabc9b87b5c5e42344d73d72b02c69e41e0a3bf8dd8fe1c9d27ecbf │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ Version: 2 │
│ │ Digest: aennzwscgtoZmsGK1kcPq7VQobC1uYk1pj8oADhjCtj │
│ └── │
│ Gas Object: │
│ ┌── │
│ │ ID: 0xc5ea5446fdabc9b87b5c5e42344d73d72b02c69e41e0a3bf8dd8fe1c9d27ecbf │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ Version: 2 │
│ │ Digest: aennzwscgtoZmsGK1kcPq7VQobC1uYk1pj8oADhjCtj │
│ └── │
│ Gas Cost Summary: │
│ Storage Cost: 1960800 NANOS │
│ Computation Cost: 1000000 NANOS │
│ Storage Rebate: 0 NANOS │
│ Non-refundable Storage Fee: 0 NANOS │
│ │
│ Transaction Dependencies: │
│ AS3GZusoMp8xxPvPBvwbUYnPPH7GxVNxnjkgLXzQAPPk │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────────────╮
│ No transaction block events │
╰─────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Object Changes │
├──────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Created Objects: │
│ ┌── │
│ │ ObjectID: 0x66cb2f98a4cbb9da278e197ec7fe675f9e47b12c13aac731c94f46d29153d425 │
│ │ Sender: 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ ObjectType: 0x2::coin::Coin<0x2::iota::IOTA> │
│ │ Version: 2 │
│ │ Digest: Zy4jEt7kaFEjeaFRnbw9BRSo8CJibJXD2JtLeVe3duc │
│ └── │
│ Mutated Objects: │
│ ┌── │
│ │ ObjectID: 0xc5ea5446fdabc9b87b5c5e42344d73d72b02c69e41e0a3bf8dd8fe1c9d27ecbf │
│ │ Sender: 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ ObjectType: 0x2::coin::Coin<0x2::iota::IOTA> │
│ │ Version: 2 │
│ │ Digest: aennzwscgtoZmsGK1kcPq7VQobC1uYk1pj8oADhjCtj │
│ └── │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Balance Changes │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ┌── │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ CoinType: 0x2::iota::IOTA │
│ │ Amount: 1000000000 │
│ └── │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
Dry run completed, execution status: success
Estimated gas cost (includes a small buffer): 3960800 NANOS

dev-inspect Example

iota client ptb \
--move-call iota::tx_context::sender \
--assign sender \
--split-coins gas "[1000000000]" \
--assign coin \
--transfer-objects "[coin]" sender \
--dev-inspect
Output:
Dev inspect completed, execution status: success
╭───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Transaction Effects │
├───────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Digest: DkkfwFB3qqojaKaijocXhWYwHhDysEQEceZpwDBaoBgv │
│ Status: Success │
│ Executed Epoch: 67 │
│ │
│ Created Objects: │
│ ┌── │
│ │ ID: 0x66cb2f98a4cbb9da278e197ec7fe675f9e47b12c13aac731c94f46d29153d425 │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ Version: 2 │
│ │ Digest: Zy4jEt7kaFEjeaFRnbw9BRSo8CJibJXD2JtLeVe3duc │
│ └── │
│ Mutated Objects: │
│ ┌── │
│ │ ID: 0xbb846ea192d85cd7088f05571b0a324dbecd3e4d8cb0144af1383adbcc143644 │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ Version: 2 │
│ │ Digest: 9nZx2QNK7hvBDXLHQazCg4p32pfGcXtXJ3HrEuYGgnjH │
│ └── │
│ Gas Object: │
│ ┌── │
│ │ ID: 0xbb846ea192d85cd7088f05571b0a324dbecd3e4d8cb0144af1383adbcc143644 │
│ │ Owner: Account Address ( 0xa5657935a0698bf654ce4ceb66b5a6d6a371a934a6afcfd1e191aa2ee460c8cc ) │
│ │ Version: 2 │
│ │ Digest: 9nZx2QNK7hvBDXLHQazCg4p32pfGcXtXJ3HrEuYGgnjH │
│ └── │
│ Gas Cost Summary: │
│ Storage Cost: 1960800 NANOS │
│ Computation Cost: 1000000 NANOS │
│ Storage Rebate: 0 NANOS │
│ Non-refundable Storage Fee: 0 NANOS │
│ │
│ Transaction Dependencies: │
│ AS3GZusoMp8xxPvPBvwbUYnPPH7GxVNxnjkgLXzQAPPk │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────────────╮
│ No transaction block events │
╰─────────────────────────────╯
Execution Result
Return values
IOTA TypeTag: IotaTypeTag("address")
Bytes: [165, 101, 121, 53, 160, 105, 139, 246, 84, 206, 76, 235, 102, 181, 166, 214, 163, 113, 169, 52, 166, 175, 207, 209, 225, 145, 170, 46, 228, 96, 200, 204]
Mutable Reference Outputs
IOTA Argument: GasCoin
IOTA TypeTag: IotaTypeTag("0x2::coin::Coin<0x2::iota::IOTA>")
Bytes: [187, 132, 110, 161, 146, 216, 92, 215, 8, 143, 5, 87, 27, 10, 50, 77, 190, 205, 62, 77, 140, 176, 20, 74, 241, 56, 58, 219, 204, 20, 54, 68, 0, 210, 206, 244, 220, 0, 0, 0]
Return values
IOTA TypeTag: IotaTypeTag("0x2::coin::Coin<0x2::iota::IOTA>")
Bytes: [102, 203, 47, 152, 164, 203, 185, 218, 39, 142, 25, 126, 199, 254, 103, 95, 158, 71, 177, 44, 19, 170, 199, 49, 201, 79, 70, 210, 145, 83, 212, 37, 0, 202, 154, 59, 0, 0, 0, 0]

The following example is only possible with dev-inspect as it returns a borrowed value from a function:

iota client ptb \
--assign hello_option "some('Hello')" \
--move-call std::option::borrow "<std::string::String>" hello_option \
--dev-inspect

Result section from the output:

Execution Result
Return values
IOTA TypeTag: IotaTypeTag("0x1::string::String")
Bytes: [5, 72, 101, 108, 108, 111]