# Solana SPL Token — card for AI agents

JavaScript API for interacting with Solana's SPL Token program.

Category: Crypto and web3 · npm package `@solana/spl-token` · latest version 0.4.15 (checked 2026-11-01)
Install: `npm install @solana/spl-token`
License: Apache-2.0 (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## SPL Token (Token 2022)
- Check which JS client the project uses. It is either the Kit-generated client in `clients/js` or the JS-legacy client in `clients/js-legacy`, which uses `@solana/web3.js`.
- Build both programs with `make build-sbf-program` and `make build-sbf-confidential-elgamal-registry` before running `make restart-test-validator`.
- Stop the local validator with `make stop-test-validator`.
- Once the IDL has been generated, run `pnpm install` (only once), then `make generate-clients`.
- Run program checks with `make test-program`, `make format-check-program` and `make clippy-program`.
- The Token 2022 program id is `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb`. Its IDL can be fetched with `npx @solana-program/program-metadata@latest fetch idl TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb --output ./idl.json`.

## What it is
- The GitHub repository behind this package describes itself as "The SPL Token 2022 program and its clients". It was created on 2024-05-09 and is licensed Apache-2.0.
- The README says the repo contains two on-chain programs. The token-2022 program lives in `program`. An ElGamal pubkey registry program lives in `confidential/elgamal-registry`. The token-2022 program has a published IDL, and the README explains how to generate clients from it. It lists four clients: a JS client "auto-generated with Kit", a JS-legacy client using `@solana/web3.js`, an auto-generated Rust client and a Rust legacy client.
- The latest release, program@v11.1.0, includes instructions for verifying the build and a link to an audit report for that release.

## Caveats
- README's npm badge names another package: The README's npm badge links to `@solana-program/token-2022`. None of the sources mention `@solana/spl-token` by name.
- Two JS clients, one labeled legacy: The README lists a Kit-generated JS client and a "JS-legacy" client that uses `@solana/web3.js`. Apart from those labels, the README does not explain how the two differ.
- Local validator needs both programs built: Before you start the test validator, you must build both the token-2022 program and the ElGamal registry program.
- CPI Guard now covers WithdrawExcessLamports: The v11.1.0 changelog includes enforcing CPI Guard for `WithdrawExcessLamports` on token accounts.

## Numbers (AgentGid data)
- Gid Score: 56.9 (#1270 of all tools, 13 of 155 in its category)
- Used in 11 public projects set up for AI coding agents (0.2%)
- Downloads last week: 2,164,129 (as of 2026-11-24), +43.5% over 4 weeks
- GitHub stars: 227 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Solana Web3.js 98.9%, Anchor 30.9%, Solana Wallet Adapter 29.3%, TypeScript 76.4%, ts-node 23.1%, Metaplex 22.1%

## Links
- AgentGid page: https://agentgid.com/tools/solana-spl-token/
- Homepage: https://github.com/solana-program/token-2022#readme
- Repository: https://github.com/solana-program/token-2022
- Source: https://github.com/solana-program/token-2022#readme
- Source: https://github.com/solana-program/token-2022
- Source: https://github.com/solana-program/token-2022/releases

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
