# @solana/rpc-api

> Defines all default Solana RPC methods as types

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

## Install

```sh
npm install @solana/rpc-api
pnpm add @solana/rpc-api
yarn add @solana/rpc-api
bun add @solana/rpc-api
```

## 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 | 2024-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.18.0 |
| Dependencies | 11 |
| Unpacked size | 631.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 696 |
| Author | Solana Labs Maintainers |
| Maintainers | solana-devs |
| Keywords | blockchain, solana, web3 |

## Links

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

## Dependencies (11)

- [@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/rpc-spec](https://npm.io/package/@solana/rpc-spec.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/codecs-core](https://npm.io/package/@solana/codecs-core.md) 8.3.0
- [@solana/transactions](https://npm.io/package/@solana/transactions.md) 8.3.0
- [@solana/codecs-strings](https://npm.io/package/@solana/codecs-strings.md) 8.3.0
- [@solana/rpc-parsed-types](https://npm.io/package/@solana/rpc-parsed-types.md) 8.3.0
- [@solana/rpc-transformers](https://npm.io/package/@solana/rpc-transformers.md) 8.3.0
- [@solana/transaction-messages](https://npm.io/package/@solana/transaction-messages.md) 8.3.0

## Recent versions

- 8.3.0 (latest) — 2026-09-09
- 8.4.0-canary-20260925083045 (canary) — 2026-09-25
- 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-20260924083259 — 2026-09-24
- 8.4.0-canary-20260923083123 — 2026-09-23
- 8.4.0-canary-20260922155338 — 2026-09-22
- 8.4.0-canary-20260922151509 — 2026-09-22
- … 1813 more at https://npm.io/package/@solana/rpc-api/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/rpc-api?style=flat
[npm-image]: https://img.shields.io/npm/v/@solana/rpc-api?style=flat
[npm-url]: https://www.npmjs.com/package/@solana/rpc-api

# @solana/rpc-api

This package contains types that describe the [methods](https://solana.com/docs/rpc/http) of the Solana JSON RPC API, and utilities for creating a `RpcApi` implementation with sensible defaults. 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).

Each RPC method is described in terms of a TypeScript type of the following form:

```ts
type ExampleApi = {
    getSomething(address: Address): Something;
};
```

A `RpcApi` that implements `ExampleApi` will ultimately expose its defined methods on any `Rpc` that uses it.

```ts
const rpc: Rpc<ExampleApi> = createExampleRpc(/* ... */);
const something: Something = await rpc.getSomething(address('95DpK3y3GF7U8s1k4EvZ7xqyeCkhsHeZaE97iZpHUGMN')).send();
```

## Types

### `SolanaRpcApi{Devnet|Testnet|Mainnet}`

These types represent the RPC methods available on a specific Solana cluster.

For instance, the test clusters support the `RequestAirdropApi` while mainnet does not.

## Functions

### `createSolanaRpcApi(config)`

Creates a `RpcApi` implementation of the Solana JSON RPC API with some default behaviours.

The default behaviours include:

- A transform that converts `bigint` inputs to `number` for compatibility with version 1.0 of the Solana JSON RPC.
- A transform that calls the config's `onIntegerOverflow` handler whenever a `bigint` input would overflow a JavaScript IEEE 754 number. See [this](https://github.com/solana-labs/solana-web3.js/issues/1116) GitHub issue for more information.
- A transform that applies a default commitment wherever not specified

#### Arguments

A config object with the following properties:

- `defaultCommitment`: An optional default `Commitment` value. Given an RPC method that takes `commitment` as a parameter, this value will be used when the caller does not supply one.
- `onIntegerOverflow(request, keyPath, value): void`: An optional function that will be called whenever a `bigint` input exceeds that which can be expressed using JavaScript numbers. This is used in the default `SolanaRpcApi` to throw an exception rather than to allow truncated values to propagate through a program.

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