
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
@chainstream-io/sdk
Advanced tools
Official TypeScript/JavaScript client library for ChainStream API.
npm install @chainstream-io/sdk
# or
pnpm add @chainstream-io/sdk
# or
yarn add @chainstream-io/sdk
import { ChainStreamClient } from '@chainstream-io/sdk';
// Create client
const client = new ChainStreamClient('your-access-token', {
autoConnectWebSocket: false
});
// Subscribe to token stats via WebSocket
const unsubscribe = client.stream.subscribeTokenStats({
chain: 'solana',
tokenAddress: 'So11111111111111111111111111111111111111112',
callback: (data) => {
console.log('Token stats:', data);
}
});
// Unsubscribe when done
unsubscribe.unsubscribe();
Ranking token metric list streams are deprecated and no longer published by the server. For ranking or new-pool cards, collect the token addresses first, then subscribe to per-token metric streams in one batch:
const unsubs = client.stream.batchSubscribe(() =>
tokenAddresses.flatMap(tokenAddress => [
client.stream.subscribeTokenStats({ chain: 'sol', tokenAddress, callback: onStats }),
client.stream.subscribeTokenHolders({ chain: 'sol', tokenAddress, callback: onHolders }),
client.stream.subscribeTokenSupply({ chain: 'sol', tokenAddress, callback: onSupply }),
client.stream.subscribeTokenLiquidity({ chain: 'sol', tokenAddress, callback: onGeneralStat }),
]),
);
For new-pool experiences, subscribe with subscribeNewPool({ chain: 'sol' }), read the token address from the pool event, batch subscribe the token metrics above, and use subscribeDexPoolBalance for pool liquidity updates.
Prediction PNL realtime uses compact wire fields, but the SDK callback maps them back to the same summary, dailyPnls, and changedTokens field names returned by GET /v1/prediction/wallets/{wallet}/pnl.
const wallet = '0x674f8fc1ee68c44e988e25316984cd7ea354ca64';
const tag = 'worldcup_2026';
const initial = await client.prediction.getPredictionWalletPnl(wallet, {
tag,
limit: 50,
sort_by: 'totalPnl',
order: 'desc',
});
renderPredictionPnl(initial.summary, initial.tokens);
const unsubscribeTag = client.stream.subscribePredictionWalletPnl({
wallet,
tag,
callback: event => {
renderPredictionPnlSummary(event.summary);
mergeChangedTokens(event.changedTokens);
},
});
const unsubscribeToken = client.stream.subscribePredictionWalletPnl({
wallet,
tokenId: '115556263888245616435851357148058235707004733438163639091106356867234218207169',
callback: event => {
mergeChangedTokens(event.changedTokens);
},
});
Wallet-global prediction PNL channels are available through subscribePredictionWalletPnl({ wallet }), but the backend keeps them disabled by default to avoid unnecessary global aggregation and push load.
For detailed documentation, visit https://docs.chainstream.io
# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Generate OpenAPI client
pnpm orval
# Lint
pnpm lint
# Format
pnpm format
MIT
FAQs
API and Stream client for ChainStream
The npm package @chainstream-io/sdk receives a total of 1,020 weekly downloads. As such, @chainstream-io/sdk popularity was classified as popular.
We found that @chainstream-io/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.