SDK installation
Official clients call /api/v2/sdk/* on https://api.sendy.lol/api/v2 with X-API-Key. Packages are published on npm, PyPI, and crates.io; source lives in mvritz/sendy-sdk.
Environment
Put your dashboard secret in SENDY_API_KEY. SDK clients target https://api.sendy.lol/api/v2 by default, so you only pass the API key in constructors.
TypeScript
Node 18+ (fetch). Install from npm:
npm install @mvritz/sendy-sdkQuick request (compare with other languages below):
import { SendyClient } from '@mvritz/sendy-sdk';
const client = new SendyClient({
apiKey: process.env.SENDY_API_KEY!,
});
const positions = await client.walletPositions({
walletAddress: 'YOUR_WALLET',
});Rust
Async API on reqwest. Install from crates.io:
sendy-sdk = "0.1"Enable tokio with macros and rt-multi-thread on your binary. The combined example is in the selector above (Rust tab).
Python
Uses httpx. Install from PyPI:
pip install sendy-sdkThe client supports a context manager so connections close cleanly; see the Python tab in the example block.
Registry links
- TypeScript:
@mvritz/sendy-sdk - Python:
sendy-sdkimported assendy_sdk - Rust:
sendy-sdk
Realtime wallet trades
The client includes Socket.IO-backed helpers ( connectWalletTradeStream for every trade on a wallet, connectWalletTradesForToken when you only care about one mint). Dependencies pull in socket.io-client automatically.
import { SendyClient } from '@mvritz/sendy-sdk';
const client = new SendyClient({ apiKey: process.env.SENDY_API_KEY! });
const all = client.connectWalletTradeStream('YOUR_WALLET');
all.on('trade', (ev) => {});
const oneMint = client.connectWalletTradesForToken('YOUR_WALLET', 'TOKEN_MINT');
oneMint.on('trade', (ev) => {});Override the WebSocket host with wsOrigin or tweak the Socket.IO HTTP path via socketIoPath when self-hosting. Full protocol details: Trade stream, Token stream.
API reference
Wallets, Balance history, Positions, Token PnL, Activity, Mint trades, Trade stream, Token stream.