@maikers/mainframe-sdk
v1.2.4
Published
TypeScript SDK for Mainframe protocol - Powering the agentic economy through Agent-NFTs with enterprise-grade security, performance optimization, and built-in revenue sharing on Solana
Downloads
39
Maintainers
Readme
Mainframe SDK
TypeScript SDK for Mainframe protocol - Powering the agentic economy
Mainframe SDK powers the agentic economy by transforming any verified Solana NFT collection into intelligent AI agents. Create Agent-NFTs that participate in autonomous economic activities with zero-knowledge security, 10K+ operations/minute performance, and built-in revenue sharing.
What is Mainframe SDK?
The Mainframe SDK enables developers to create AI agents from verified NFT collections on Solana. Unlike other solutions that require custom integrations, Mainframe leverages Solana's native Collection.verified = true requirement - creating a permissionless yet secure system where any verified collection can participate in the agentic economy.
Built on Mainframe v1.0.0 program (mnfm211AwTDA8fGvPezYs3jjxAXgoucHGuTMUbjFssE) with elizaOS framework integration.
Perfect for DeFi trading bots, NFT collection management, gaming agents, social media automation, and any application requiring intelligent blockchain interactions.
Features
- 🔒 Zero-Knowledge Security - Client-side XChaCha20 encryption, protocol never sees private data
- ⚡ Production Performance - 10K+ ops/min throughput, <100ms cached responses
- 💰 Revenue Sharing - Built-in affiliate program with up to 50% commission
- 🛠️ Developer Experience - TypeScript-first with comprehensive tooling and testing
- 🔌 Framework Ready - Anchor, Wallet Adapter, and React integrations included
Installation
npm install @maikers/mainframe-sdkQuick Start
import { createMainnetSDK } from "@maikers/mainframe-sdk";
// Initialize SDK (protocolWallet deprecated - fetched from on-chain config)
const sdk = createMainnetSDK({
storage: { arweave: { gateway: 'https://arweave.net' } }
});
await sdk.initialize("Phantom");
// Create AI agent from verified NFT (0.05 SOL fee*)
const result = await sdk.createAgent(nftMint, {
name: "Trading Assistant",
description: "DeFi trading bot",
framework: "elizaOS",
capabilities: [{ type: "defi", plugins: ["jupiter-swap"] }]
});
// *Fee varies: Genesis collection (FREE), Partner collections (25-75% off)Complete Examples → | Full Documentation →
Revenue Sharing
Earn commission on every agent activation through the tier-based affiliate system:
// Create agent with affiliate revenue
const result = await sdk.createAgent(nftMint, agentConfig, {
affiliate: 'YOUR_WALLET_ADDRESS',
referrer: 'OPTIONAL_REFERRER_ADDRESS' // For 5% referrer bonus
});
// Track earnings
sdk.events.onAffiliatePaid((event) => {
console.log(`Earned: ${event.affiliateAmount} lamports`);
});Affiliate Tiers & Commission Rates
| Tier | Sales Required | Commission Rate | |------|----------------|-----------------| | 🥉 Bronze | 0-99 | 15% | | 🥈 Silver | 100-499 | 20% | | 🥇 Gold | 500-1,999 | 30% | | 💎 Platinum | 2,000-9,999 | 40% | | 💎💎 Diamond | 10,000+ | 50% |
Features:
- ✅ Permissionless participation - no registration required
- ✅ Auto-initialize on first commission
- ✅ Tier progression based on lifetime sales
- ✅ Single-level referrals (earn 5% from your referrals' commissions)
- ✅ Custom bonuses for promotions (set by protocol authority)
- ✅ Instant on-chain payouts
Framework Integration
React/Next.js
import { QuickStartIntegrations } from "@maikers/mainframe-sdk";
const sdk = QuickStartIntegrations.walletAdapter(wallet.adapter, connection);Anchor
import { QuickStartIntegrations } from "@maikers/mainframe-sdk";
const sdk = QuickStartIntegrations.anchor(provider);Integration Examples → | API Reference →
Documentation
| Guide | Description | |-------|-------------| | Quick Start | Get up and running in minutes | | API Reference | Complete method documentation | | Security Model | Architecture and best practices | | Integration Examples | Framework-specific patterns | | Performance Guide | Optimization strategies | | Release Management | Versioning and publishing guide | | Troubleshooting | Common issues and solutions |
Development
git clone https://github.com/MaikersHQ/maikers-mainframe-sdk
cd maikers-mainframe-sdk
pnpm install && pnpm run buildContributing Guide → | Development Setup → | Release Process →
Resources
- NPM Package - Official package
- Documentation Hub - Complete docs
- Discord Community - Get support
- GitHub Issues - Report bugs
- Enterprise Support - Business inquiries
License
Apache 2.0 - see LICENSE
Built by maikers - creators of realities
