@solana/kit-client-litesvm
v0.6.2
Published
Pre-configured LiteSVM client for Solana Kit
Readme
Kit Plugins ➤ LiteSVM Client
This package provides a pre-configured LiteSVM client for Solana Kit. It bundles several plugins together so you can get started with a single function call.
[!NOTE] This package is only available in Node.js environments. LiteSVM relies on Node.js APIs and cannot run in browsers or React Native.
Installation
pnpm install @solana/kit-client-litesvmcreateClient
Pre-configured client using LiteSVM for testing without an RPC connection.
import { createClient } from '@solana/kit-client-litesvm';
const client = await createClient();
// Set up test environment
client.svm.setAccount(myTestAccount);
client.svm.addProgramFromFile(myProgramAddress, 'program.so');
// Execute transactions locally
await client.sendTransaction([myInstruction]);Features
client.svm: Embedded LiteSVM instance for local blockchain simulation.client.rpc: Subset of RPC methods that delegate to the LiteSVM instance.client.payer: The main payer signer for transactions.client.airdrop: Function to request SOL from the LiteSVM instance.client.transactionPlanner: Plans instructions into transaction messages.client.transactionPlanExecutor: Executes planned transaction messages.client.planTransactions: Plans transaction messages, instructions or instruction plans into a transaction plan without executing it.client.planTransaction: Same asclient.planTransactionsbut asserts a single transaction message is returned.client.sendTransactions: Sends transaction messages, instructions or instruction plans to the cluster by using the client's transaction planner and executor.client.sendTransaction: Same asclient.sendTransactionsbut ensuring only a single transaction is sent.
Configuration
| Option | Type | Description |
| ------- | ------------------- | --------------------------------------------------------------------------------------------------------------- |
| payer | TransactionSigner | Signer used to pay for transaction fees and on-chain account storage. Defaults to a generated and funded payer. |
