Developer SDK
Build with Modulr
Integrate wallet risk, token launch readiness, and smart contract auditing directly into your app. One SDK, no setup required.
Quickstart
Install the SDK and start making calls in minutes. No API key required.
Install
npm install @modulr/sdk
TypeScript / Node.js
import { Modulr } from '@modulr/sdk'
const modulr = new Modulr()
// Wallet risk
const risk = await modulr.walletRisk.analyze('9apA5U8...')
console.log(risk.riskLevel, risk.riskScore)
// Token launch
const launch = await modulr.tokenLaunch.check({
projectName: 'MyToken',
chain: 'Solana',
launchStage: 'Pre-launch',
})
console.log(launch.readinessScore, launch.riskFlags)
// Smart contract audit
const audit = await modulr.audit.scan({
contractText: '// your contract code',
language: 'Solidity',
reviewDepth: 'Standard Review',
})
console.log(audit.riskLevel, audit.findings)
// AI agent generator
const agent = await modulr.agent.generate({
agentName: 'Whale Tracker',
agentType: 'Wallet Monitor',
targetChain: 'Solana',
framework: 'Vanilla TypeScript',
description: 'Monitor a wallet for large SOL movements',
})
console.log(agent.scriptContent)Modules
Each module maps directly to a Modulr tool.
Analyze any Solana wallet. Returns risk score, risk level, wallet type, warning signals, activity breakdown and full explainability.
Method
Returns
{
riskLevel: "Low Risk" | "Medium Risk" | "High Risk",
riskScore: number, // 0–100
walletType: string,
warningSignals: string[],
positiveSignals: string[],
scoreBreakdown: { ... },
generatedAt: string
}Generate a launch readiness report for any token project. Returns a readiness score, checklist sections, risk flags and next steps.
Method
Returns
{
readinessScore: number, // 0–100
readinessLevel: string,
sections: ChecklistSection[],
riskFlags: string[],
nextSteps: string[],
generatedAt: string
}Static analysis on Solidity, Rust/Anchor or Move contracts. Returns findings by severity, a security checklist, and a deploy recommendation.
Method
Returns
{
riskLevel: string,
riskScore: number, // 0–100
findings: AuditFinding[],
securityChecklist: [...],
deployRecommendation: string,
suggestedFixes: string[],
generatedAt: string
}Generate complete TypeScript agent scripts for trading, monitoring, alerts and DeFi automation.
Method
Returns
{
scriptContent: string, // complete .ts file
setupInstructions: string[],
requiredEnvVars: string[],
dependencies: string[],
generatedAt: string
}Generate a production-ready HTML token launch website with hero, tokenomics, roadmap and how-to-buy sections.
Method
Returns
{
html: string, // complete HTML file
// includes: hero, tokenomics,
// roadmap, how-to-buy sections
generatedAt: string
}Agent-Native Payments (x402)
All Modulr tools are available as x402-payable endpoints. AI agents pay in USDC on Solana with no API key, no signup, and no manual steps — the payment is negotiated and settled automatically on every request.
Wallet risk report
{ "address": "9apA5U8..." }Token launch checklist
{ "projectName": "MyToken", "chain": "Solana", "launchStage": "Pre-launch", ... }Smart contract audit
{ "contractText": "...", "language": "Solidity", "reviewDepth": "Standard Review" }AI agent generator
{ "agentName": "...", "agentType": "Trading Bot", "targetChain": "Solana", "framework": "Vanilla TypeScript", "description": "..." }Token website generator
{ "tokenName": "...", "ticker": "...", "contractAddress": "...", "description": "...", "tokenomics": "...", "roadmap": "..." }x402 Quickstart — call any endpoint as an agent
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactSvmScheme } from "@x402/svm/exact/client";
import { createKeyPairSignerFromBytes } from "@solana/kit";
import { base58 } from "@scure/base";
// Create a signer from your Solana private key
const svmSigner = await createKeyPairSignerFromBytes(
base58.decode(process.env.SOLANA_PRIVATE_KEY)
);
// Wrap fetch — payment is handled automatically on 402 responses
const client = new x402Client();
registerExactSvmScheme(client, { signer: svmSigner });
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
// Call any Modulr x402 endpoint — the client pays and retries automatically
const response = await fetchWithPayment("https://modulr402.com/api/x402/wallet-risk", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ address: "9apA5U8..." }),
});
const report = await response.json();
console.log(report.riskLevel, report.riskScore);API Reference
The SDK wraps the Modulr REST API. You can also call the free endpoints directly.
{ "address": "9apA5U8..." }{ "projectName": "MyToken", "chain": "Solana", "launchStage": "Pre-launch", ... }{ "contractText": "...", "language": "Solidity", "reviewDepth": "Standard Review" }{ "tokenName": "MyToken", "ticker": "MTK", "contractAddress": "...", "description": "...", "vibe": "professional" }{ "agentName": "Whale Tracker", "agentType": "Wallet Monitor", "targetChain": "Solana", "framework": "Vanilla TypeScript", "description": "..." }Error handling
import { Modulr, ModulrError } from '@modulr/sdk'
const modulr = new Modulr()
try {
const report = await modulr.walletRisk.analyze('address')
} catch (err) {
if (err instanceof ModulrError) {
console.error(err.message)
console.error(err.status) // 400 | 408 | 503
}
}Configuration
All options are optional. The SDK works out of the box with no configuration.
