Skip to main content
Compiles a DRAFT transaction to wire format, transitioning it to COMPILED state. If recent_blockhash is not supplied, the service fetches the latest blockhash automatically — this is the standard pattern.
After compilation, instructions cannot be added or removed. The instructions field on the returned transaction is no longer the source of truth — the transaction is now encoded in data.

Request

Transaction (object)
required
Draft transaction in DRAFT state containing the instructions to compile.
Base58-encoded public key (string)
required
Address that will pay transaction fees.
Base58-encoded string (optional)
Optional. If empty, the service fetches the latest blockhash. Supply only for durable nonce transactions.

Response

Transaction (object)
The compiled transaction in COMPILED state.

Code Examples