Skip to main content

Transaction Formats

TxBuilder builds v1 transactions. Use it with a cluster that has activated v1; legacy and v0 factories remain available.

Build, Simulate, Sign, and Submit

Simulation supplies the blockhash. The example adds budget margins; adjust them for your program. Submission returns a signature; confirmation is a separate step.

Budgets and Priority Fees

The builder defaults to 1,400,000 compute units and 64 MiB of loaded account data. Zero omits either field and leaves a zero budget, so do not use zero to request defaults. V1 transaction setters update fields already present; rebuild to add an omitted field. V1 priority fees are total lamports. To convert a legacy/v0 price in micro-lamports per compute unit:
The conversion uses the current compute limit once. Changing that limit later does not change the fee; convert again if needed.

Read and Rebuild

TransactionSkeleton.deserializeSkeleton reads all three formats. For legacy or v1:
For v0 with lookup-table accounts, use skeleton.parseAccounts(lookupTables) with a Map<PublicKey, AddressLookupTable> before parsing instructions. skeleton.prototypeTransaction(instructions) creates a v1 builder from the resolved instructions and budgets. Set a fresh blockhash and sign the rebuilt transaction.