Programmable Transaction Blocks
What is a programmable transaction block?
Programmable transaction blocks (PTBs) let you compose multiple commands into a single atomic transaction on Sui, meaning the commands succeed or fail together. Commands can transfer objects, call Move functions, split and merge coins, and more, with results from one command flowing into the next.
What is a PTB?
Programmable transaction blocks are a group of commands that complete a transaction on Sui.
Building Transactions
Using the Sui TypeScript SDK and the Sui CLI, you can create programmable transaction blocks to perform multiple commands in a single transaction, including gas configuration and offline building.
Inputs and Results
Programmable transaction blocks accept two types of inputs (objects and pure values) and produce results that subsequent commands can use.
Sending PTBs
Add programmable transaction blocks to an existing app with the Sui TypeScript SDK. Covers ES module configuration, signing with a backend keypair, and signing through a user's wallet with Sui dApp Kit.
Cookbook
End-to-end TypeScript examples for common PTB patterns: sponsored transactions, kiosk borrow/return, coin selection, and multi-recipient transfers.