# @solana/transactions

> Helpers for creating and serializing transactions

Latest version **8.3.0** (published 2026-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @solana/transactions
pnpm add @solana/transactions
yarn add @solana/transactions
bun add @solana/transactions
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.3.0 |
| Published | 2026-09-09 |
| First published | 2023-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.18.0 |
| Dependencies | 12 |
| Unpacked size | 609.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 695 |
| Author | Solana Labs Maintainers |
| Maintainers | solana-devs |
| Keywords | blockchain, solana, web3 |

## Links

- npm: https://www.npmjs.com/package/@solana/transactions
- Repository: https://github.com/anza-xyz/kit
- Homepage: https://www.solanakit.com/api#solanatransactions
- Issues: https://github.com/anza-xyz/kit/issues
- npm.io page: https://npm.io/package/@solana/transactions

## Dependencies (12)

- [@solana/keys](https://npm.io/package/@solana/keys.md) 8.3.0
- [@solana/errors](https://npm.io/package/@solana/errors.md) 8.3.0
- [@solana/addresses](https://npm.io/package/@solana/addresses.md) 8.3.0
- [@solana/rpc-types](https://npm.io/package/@solana/rpc-types.md) 8.3.0
- [@solana/functional](https://npm.io/package/@solana/functional.md) 8.3.0
- [@solana/codecs-core](https://npm.io/package/@solana/codecs-core.md) 8.3.0
- [@solana/instructions](https://npm.io/package/@solana/instructions.md) 8.3.0
- [@solana/nominal-types](https://npm.io/package/@solana/nominal-types.md) 8.3.0
- [@solana/codecs-numbers](https://npm.io/package/@solana/codecs-numbers.md) 8.3.0
- [@solana/codecs-strings](https://npm.io/package/@solana/codecs-strings.md) 8.3.0
- [@solana/transaction-messages](https://npm.io/package/@solana/transaction-messages.md) 8.3.0
- [@solana/codecs-data-structures](https://npm.io/package/@solana/codecs-data-structures.md) 8.3.0

## Recent versions

- 8.3.0 (latest) — 2026-09-09
- 8.4.0-canary-20260922151509 (canary) — 2026-09-22
- 5.1.0-experimental-20251205104522 (experimental) — 2025-12-05
- 4.0.0 (4x) — 2025-10-08
- 3.0.3 (3x) — 2025-09-11
- 2.0.0 (next) — 2024-11-07
- 2.0.0-rc.4 (rc) — 2024-11-05
- 2.0.0-preview.4.20240731091009.c2717fc498afa3228c8f8b01600a575989afae99 (preview) — 2024-07-31
- 2.0.0-preview.4 (tp4) — 2024-07-02
- 2.0.0-preview.3 (tp3) — 2024-04-25
- 2.0.0-preview.2 (tp2) — 2024-03-19
- 8.4.0-canary-20260922084122 — 2026-09-22
- 8.4.0-canary-20260922083419 — 2026-09-22
- 8.4.0-canary-20260921145441 — 2026-09-21
- 8.4.0-canary-20260921085643 — 2026-09-21
- … 2232 more at https://npm.io/package/@solana/transactions/versions

## README

[![npm][npm-image]][npm-url]
[![npm-downloads][npm-downloads-image]][npm-url]
<br />
[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]

[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
[code-style-prettier-url]: https://github.com/prettier/prettier
[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/transactions?style=flat
[npm-image]: https://img.shields.io/npm/v/@solana/transactions?style=flat
[npm-url]: https://www.npmjs.com/package/@solana/transactions

# @solana/transactions

This package contains types and functions for compiling, signing and sending transactions. It can be used standalone, but it is also exported as part of Kit [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).

Transactions are created by compiling a transaction message. They must then be signed before being submitted to the network.

## Compiling a transaction

### Functions

#### `compileTransaction()`

Given a `TransactionMessage`, this function returns a `Transaction` object. This includes the compiled bytes of the transaction message, and a map of signatures. This map will have a key for each address that is required to sign the transaction. The transaction will not yet have signatures for any of these addresses.

Whether a transaction message is ready to be compiled or not is enforced for you at the type level. In order to be signable, a transaction message must:

- have a version and a list of zero or more instructions (ie. conform to `TransactionMessage`)
- have a fee payer set (ie. conform to `TransactionMessageWithFeePayer`)
- have a lifetime specified (ie. conform to `TransactionMessageWithBlockhashLifetime | TransactionMessageWithDurableNonceLifetime`)

## Signing transactions

In order to be landed on the network, a transaction must be signed by all of the private keys belonging to accounts that are required signers of the transaction.

### Types

#### `FullySignedTransaction`

This type represents a transaction that is signed by all of its required signers.

#### `TransactionWithSizeLimit`

This type represents a transaction that is under or equal to the maximum size limit for transactions on the Solana network.

#### `SendableTransaction`

This type represents a transaction that has all the required conditions to be sent to the network. Namely:

- It must be fully signed (ie. conform to `FullySignedTransaction`)
- It must be within size limit (ie. conform to `TransactionWithSizeLimit`)

The `SendableTransaction` type is a prerequisite of functions designed to land transactions on the network.

### Functions

#### `getSignatureFromTransaction()`

Given a transaction signed by its fee payer, this method will return the `Signature` that uniquely identifies it. This string can be used to look up transactions at a later date, for example on a Solana block explorer.

```ts
import { getSignatureFromTransaction } from '@solana/transactions';

const signature = getSignatureFromTransaction(tx);
console.debug(`Inspect this transaction at https://explorer.solana.com/tx/${signature}`);
```

### `signTransaction()`

Given an array of `CryptoKey` objects which are private keys pertaining to addresses that are required to sign a transaction, this method will return a new signed transaction of type `FullySignedTransaction`. This function will throw unless the resulting transaction is fully signed.

```ts
import { generateKeyPair } from '@solana/keys';
import { signTransaction } from '@solana/transactions';

const signedTransaction = await signTransaction([myPrivateKey], tx);
```

### `partiallySignTransaction()`

This function is the same as `signTransaction()` but does not require the transaction to be signed by all signers. A partially signed transaction cannot be landed on the network, but can be serialized and deserialized.

## Serializing transactions

Before sending a transaction to be landed on the network, you must serialize it in a particular way. You can use these types and functions to serialize a signed transaction into a binary format suitable for transit over the wire.

### Types

#### `Base64EncodedWireTransaction`

This type represents the wire format of a transaction as a base64-encoded string.

### Functions

#### `getBase64EncodedWireTransaction()`

Given a signed transaction, this method returns the transaction as a string that conforms to the `Base64EncodedWireTransaction` type.

```ts
import { getBase64EncodedWireTransaction, signTransaction } from '@solana/transactions';

const serializedTransaction = getBase64EncodedWireTransaction(signedTransaction);
const signature = await rpc.sendTransaction(serializedTransaction, { encoding: 'base64' }).send();
```

---
_Source: https://npm.io/package/@solana/transactions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
