Solana SPL Token
JavaScript API for interacting with Solana's SPL Token program.
3. Used by agents' projects
Dependency in 11 public GitHub projects set up for AI coding agents that we scanned (0.2%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Solana SPL Token does
The package's source lives in the solana-program/token-2022 repository, which holds the on-chain Token 2022 program, a second ElGamal registry program and JS and Rust clients generated from the program's IDL; its latest release notes add build verification steps and an audit link.
Solana SPL Token popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Solana SPL Token is used
- Solana SPL Token is a dependency in 11 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 1,087 projects, and what it is used with below comes from all of them.
- Projects that use it most often also use Solana Web3.js (98.9%), Anchor (30.9%), Solana Wallet Adapter (29.3%).
By coding agent
Often used with
Solana SPL Token in practice
Strengths
The README lists four clients for the token-2022 program. They are a JS client auto-generated with Kit, a JS-legacy client built on <code>@solana/web3.js</code>, an auto-generated Rust client and a Rust legacy client.
The token-2022 program has a published <code>idl.json</code>. Once the IDL has been generated, the README says to run <code>pnpm install</code> once, then <code>make generate-clients</code>.
The program@v11.1.0 release notes say the build uses solana-verifiable-build. They give the <code>solana-verify</code> commands and the expected executable hash, and they point to public verification through OtterSec's API.
The latest release notes link an audit report for that release. The report is a PDF in the anza-xyz security-audits repository.
Watch out for
The README's npm badge links to <code>@solana-program/token-2022</code>. None of the sources mention <code>@solana/spl-token</code> by name.
The README lists a Kit-generated JS client and a "JS-legacy" client that uses <code>@solana/web3.js</code>. Apart from those labels, the README does not explain how the two differ.
Before you start the test validator, you must build both the token-2022 program and the ElGamal registry program.
Start a local validator with both programs
make build-sbf-program # you only need to run this once
make build-sbf-confidential-elgamal-registry # you only need to run this once
make restart-test-validatorMore about Solana SPL Token
Packages around it
- @solana/web3.js: Solana JS SDK
- @coral-xyz: Anchor framework
- @solana/wallet-adapter-react: React wallet connection
- @metaplex-foundation: Token and NFT metadata
- ts-node: Run TypeScript in Node
- dotenv: Load .env variables
Alternatives
Solana SPL Token This page
Get started
Install it.
npm install @solana/spl-tokenRules for your agent
## 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`.