
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
This is the NodeJS wrapper for LiteSVM. It brings best-in-class Solana testing to NodeJS, giving you a powerful, fast and ergonomic way to test Solana programs in TS/JS.
For a standard testing workflow, LiteSVM offers an experience superior to solana-test-validator (slow, unwieldy)
and bankrun (reasonably fast and powerful, but inherits a lot of warts from solana-program-test).
This example just transfers lamports from Alice to Bob without loading any programs of our own. It uses the Node.js test runner.
import { test } from "node:test";
import assert from "node:assert/strict";
import { LiteSVM } from "litesvm";
import { getTransferSolInstruction } from "@solana-program/system";
import {
appendTransactionMessageInstruction,
createTransactionMessage,
generateKeyPairSigner,
lamports,
pipe,
setTransactionMessageFeePayerSigner,
setTransactionMessageLifetimeUsingBlockhash,
signTransactionMessageWithSigners,
} from "@solana/kit";
test("it transfers SOL from one wallet to another", async () => {
// Given a payer with 2 SOL and a recipient with 0 SOL.
const svm = new LiteSVM();
const payer = await generateKeyPairSigner();
const recipient = await generateKeyPairSigner();
svm.airdrop(payer.address, lamports(2_000_000_000n));
// When we send 1 SOL from the payer to the recipient.
const instruction = getTransferSolInstruction({
source: payer,
destination: recipient.address,
amount: lamports(1_000_000_000n),
});
const transaction = await pipe(
createTransactionMessage({ version: 0 }),
(tx) => setTransactionMessageFeePayerSigner(payer, tx),
(tx) => svm.setTransactionMessageLifetimeUsingLatestBlockhash(tx),
(tx) => appendTransactionMessageInstruction(instruction, tx),
(tx) => signTransactionMessageWithSigners(tx),
);
svm.sendTransaction(transaction);
// Then we expect the accounts to have the correct balances.
assert.strictEqual(
svm.getBalance(recipient.address),
lamports(1_000_000_000n),
);
assert(svm.getBalance(payer.address) < lamports(1_000_000_000n));
});
Note: by default the LiteSVM instance includes some core programs such as
the System Program and SPL Token.
yarn add litesvm
Make sure you have Yarn and the Rust toolchain installed.
Then run yarn to install deps, run yarn build to build the binary and yarn test to run the tests.
FAQs
Unknown package
The npm package litesvm receives a total of 20,747 weekly downloads. As such, litesvm popularity was classified as popular.
We found that litesvm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.