A comprehensive SDK and CLI tool for interacting with SurfPool RPC APIs.
- π― SDK Library - Type-safe SDK for programmatic API interaction
- β‘ CLI Tool - Command-line interface for quick operations
- π Web UI - Browser-based interface (coming soon)
- π WebSocket Support - Real-time state updates (planned)
Surfman is built as a monorepo using pnpm workspaces:
- @surfman/sdk - Core SDK library for programmatic use
- @surfman/cli - CLI tool for command-line operations
- @surfman/web - Web UI (coming soon)
- β
surfnet_timeTravel- Time manipulation - β
surfnet_setAccount- Account modification - β
surfnet_setProgramAuthority- Program authority management - β
surfnet_pauseClock- Pause clock - β
surfnet_resumeClock- Resume clock - β
surfnet_getLocalSignatures- Get recent signatures - β
surfnet_setTokenAccount- Token account updates - β
surfnet_resetAccount- Reset account - β
surfnet_resetNetwork- Reset network - β
surfnet_cloneProgramAccount- Clone program accounts - β
surfnet_profileTransaction- Profile transactions for compute units - β
surfnet_getProfileResultsByTag- Get profiling results by tag - β
surfnet_setSupply- Configure network supply - β
surfnet_getTransactionProfile- Get transaction profile by signature/UUID - β
surfnet_registerIdl- Register program IDL - β
surfnet_getActiveIdl- Get registered IDL - β
surfnet_exportSnapshot- Export account snapshots - β
surfnet_streamAccount- Stream accounts from data source - β
surfnet_getStreamedAccounts- Get all streamed accounts - β
surfnet_getSurfnetInfo- Get Surfnet network information - β
surfnet_writeProgram- Write program data in chunks - β
surfnet_registerScenario- Register scenarios with account overrides
- β
getLatestBlockhash- Get latest blockhash - β
getBlock- Get block details - β
getBlocks- Get confirmed blocks - β
getBlocksWithLimit- Get blocks with limit - β
getBlockTime- Get block timestamp - β
getFirstAvailableBlock- Get first available block - β
minimumLedgerSlot- Get minimum ledger slot - β
getTransaction- Get transaction details - β
getSignatureStatuses- Get signature statuses - β
getSignaturesForAddress- Get address transaction history - β
sendTransaction- Send transaction - β
simulateTransaction- Simulate transaction - β
isBlockhashValid- Validate blockhash - β
getFeeForMessage- Get transaction fee - β
getRecentPrioritizationFees- Get recent priority fees - β
getClusterNodes- Get cluster node info - β
getRecentPerformanceSamples- Get performance samples - β
requestAirdrop- Request SOL airdrop - β
getInflationReward- Get inflation rewards - β
getMaxRetransmitSlot- Get max retransmit slot - β
getMaxShredInsertSlot- Get max shred insert slot - β
getStakeMinimumDelegation- Get minimum stake delegation
- β
getAccountInfo- Get account details - β
getMultipleAccounts- Batch account query - β
getBlockCommitment- Get block commitment - β
getTokenAccountBalance- Get token balance - β
getTokenSupply- Get token supply
- β
getProgramAccounts- Get program-owned accounts - β
getLargestAccounts- Get top accounts by balance - β
getSupply- Get network supply info - β
getTokenLargestAccounts- Get largest token holders - β
getTokenAccountsByOwner- Get token accounts by owner - β
getTokenAccountsByDelegate- Get delegated token accounts
npm install -g surfmannpm install @surfman/sdkDevelopment (run directly from source):
# Time travel forward 1 week
pnpm cli time-travel --relative +1w
# Set account data
pnpm cli set-account --pubkey <ADDRESS> --lamports 1000000
# Set program authority
pnpm cli set-program-authority --program-id <ID> --new-authority <ADDRESS>Production (after installing globally):
npm install -g surfman
surfman time-travel --relative +1w
surfman set-account --pubkey <ADDRESS> --lamports 1000000
surfman set-program-authority --program-id <ID> --new-authority <ADDRESS>import { Surfman } from '@surfman/sdk';
const client = new Surfman('http://localhost:8899');
// Cheatcodes - Time Control
await client.cheatcodes.timeTravel({ absoluteEpoch: 100 });
await client.cheatcodes.pauseClock();
await client.cheatcodes.resumeClock();
// Cheatcodes - Account Management
await client.cheatcodes.setAccount(pubkey, { lamports: 1000000 });
await client.cheatcodes.setTokenAccount(owner, mint, { amount: 1000 });
await client.cheatcodes.resetAccount(pubkey);
await client.cheatcodes.resetNetwork();
// Cheatcodes - Advanced Features
await client.cheatcodes.cloneProgramAccount(sourceProgram, destProgram);
await client.cheatcodes.profileTransaction(txData, 'my-tag');
await client.cheatcodes.setSupply({ total: 1000000000 });
await client.cheatcodes.registerIdl(idl);
const snapshot = await client.cheatcodes.exportSnapshot();
await client.cheatcodes.writeProgram(programId, hexData, offset);
// Network Health
const blockhash = await client.network.getLatestBlockhash();
const block = await client.network.getBlock(1000);
const tx = await client.network.getTransaction(signature);
const signature = await client.network.sendTransaction(txData);
// Accounts Data
const account = await client.accounts.getAccountInfo(pubkey);
const accounts = await client.accounts.getMultipleAccounts([pubkey1, pubkey2]);
const balance = await client.accounts.getTokenAccountBalance(tokenAccount);
// Accounts Scan
const programAccounts = await client.scan.getProgramAccounts(programId);
const largestAccounts = await client.scan.getLargestAccounts();
const supply = await client.scan.getSupply();
const tokenHolders = await client.scan.getTokenLargestAccounts(mint);
const ownerTokens = await client.scan.getTokenAccountsByOwner(owner, { mint });
// Set account
await client.cheatcodes.setAccount('pubkey', {
lamports: 1000000,
data: 'hex-data'
});# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run in development mode
pnpm dev
# Run tests
pnpm testFull documentation available at: https://docs.surfpool.run/rpc/surfnet
MIT