@varity-labs/sdk
v2.0.0-alpha.1
Published
Varity SDK - Build any app on Varity L3 with complete thirdweb integration (Engine, Nebula AI, Storage, Bridge, Gateway, x402)
Maintainers
Readme
@varity/sdk
Complete Web3 SDK for Varity L3 - Build production-ready blockchain applications with multi-chain support, thirdweb integration, and enterprise-grade features.
Status: ✅ ALL BLOCKERS RESOLVED - Ready for End-to-End Testing (Jan 24, 2026)
Deployed Contracts (Varity L3 - Chain ID 33529)
| Contract | Address | Purpose |
|----------|---------|---------|
| TemplateMarketplace | 0x769250dac29817081f38CfBa597Ef2485F3a94e8 | 70/30 Revenue Split |
| TemplateRegistry | 0xEbD8C516c05BD2b76b5CDd56530b3Dd9f8b3D748 | Template metadata |
| VarityAppRegistry | 0x52d4f28ebe20fad743bbef9daa61bfe3ce91eb74 | App Store submissions |
| SimplifiedPaymaster | 0xeF467aef91d4e626C7e56967779069bEF22c4453 | Gas sponsorship |
| VarityWalletFactory | 0x85AB92708CB4d921f5c2BdCCd7f2D0813a380f71 | Smart wallets |
Revenue Split: 70% → Developer | 30% → Varity Platform
Installation
npm install @varity/sdk@alphaQuick Start
import { createVaritySDK, varityL3Testnet, ChainRegistry } from '@varity/sdk';
// Initialize SDK
const sdk = createVaritySDK({
network: 'testnet',
apiUrl: 'https://api.varity.io',
thirdwebClientId: 'your-client-id'
});
// Use multi-chain configuration
const chain = ChainRegistry.getChain(33529); // Varity L3
console.log('Connected to:', chain.name);
// Deploy a contract
const contract = await sdk.deployContract({
chain: varityL3Testnet,
contractType: 'nft-collection',
name: 'My Collection'
});Features
🔗 Multi-Chain Support
- Varity L3 (Chain ID 33529) - Low-cost Arbitrum Orbit rollup with USDC gas token
- Arbitrum (Sepolia & Mainnet) - Fast, low-cost L2
- Base (Sepolia & Mainnet) - Coinbase's L2 built on OP Stack
- ChainRegistry - Intelligent chain selection based on cost, speed, security
⚡ Complete thirdweb Integration
- Engine - Production transaction management with auto-retry and webhooks
- Nebula AI - Natural language blockchain interactions (generate contracts, query chains)
- Storage - Decentralized storage via IPFS/Arweave
- Bridge - Cross-chain asset transfers
- Gateway - Production RPC infrastructure with WebSocket support
- x402 - API monetization with 70/30 revenue split
- Smart Wallets - ERC-4337 gasless transactions with account abstraction
- Server Wallets - Backend automation for transaction signing
🎯 Enterprise Features
- Template system for rapid deployment (ISO, SaaS, eCommerce, Healthcare)
- Multi-tenant architecture with wallet-based isolation
- Comprehensive analytics and forecasting
- ZK proofs (ZKML, privacy-preserving computations)
- TEE support (confidential computing)
- Encryption (Lit Protocol, FHE, AES-256-GCM)
📦 Developer Experience
- TypeScript-first with full type safety
- Function-based API (thirdweb v5)
- Comprehensive error handling
- Detailed logging and monitoring
- Extensive documentation
Documentation
See docs.varity.ai/packages/sdk for full documentation.
Key Exports
Multi-Chain
import {
ChainRegistry, // Chain registry with intelligent selection
varityL3, // Varity L3 Testnet (Chain ID 33529)
arbitrum, // Arbitrum One mainnet
arbitrumSepolia, // Arbitrum Sepolia testnet
base, // Base mainnet
baseSepolia, // Base Sepolia testnet
formatUSDC, // Format USDC with 6 decimals
parseUSDC, // Parse USDC from string
} from '@varity/sdk';thirdweb Clients
import {
EngineClient, // Production transaction management
NebulaClient, // AI-powered blockchain interactions
StorageClient, // IPFS/Arweave storage
BridgeClient, // Cross-chain bridging
GatewayClient, // RPC infrastructure
x402Client, // API monetization
createThirdwebWrapper, // Base thirdweb wrapper
} from '@varity/sdk';Core SDK
import {
VaritySDK, // Main SDK class
createVaritySDK, // Factory function
TemplateRegistry, // Template management
loadISOTemplate, // Load ISO template
} from '@varity/sdk';Contract Addresses (NEW - Jan 24, 2026)
import {
VARITY_L3_CHAIN_ID, // 33529
VARITY_CONTRACTS, // All deployed contract addresses
REVENUE_SPLIT, // { DEVELOPER_PERCENT: 70, PLATFORM_PERCENT: 30 }
getVarityContractAddress, // Helper function
} from '@varity/sdk';
// Access specific contracts
const marketplaceAddress = VARITY_CONTRACTS.TemplateMarketplace;
const paymasterAddress = VARITY_CONTRACTS.SimplifiedPaymaster;
const factoryAddress = VARITY_CONTRACTS.VarityWalletFactory;Examples
Deploy Contract with Multi-Chain
import { createVaritySDK, ChainRegistry } from '@varity/sdk';
const sdk = createVaritySDK({ /* config */ });
// Auto-select cheapest chain
const chain = ChainRegistry.selectChain({
optimize: 'cost',
requirements: { testnet: true }
});
const contract = await sdk.deployContract({
chain,
contractType: 'marketplace',
name: 'My Marketplace'
});AI-Powered Contract Generation
import { NebulaClient } from '@varity/sdk';
const nebula = new NebulaClient({ apiKey: 'your-key' });
// Generate Solidity from natural language
const result = await nebula.generateContract({
prompt: 'Create an NFT marketplace with royalty splits',
language: 'solidity',
framework: 'foundry'
});
console.log(result.code); // Generated Solidity contractCross-Chain Asset Bridge
import { BridgeClient, varityL3, arbitrum } from '@varity/sdk';
const bridge = new BridgeClient({ clientId: 'your-id' });
// Get quote for bridging USDC
const quote = await bridge.getQuote({
fromChain: varityL3,
toChain: arbitrum,
amount: 1000000n, // 1 USDC (6 decimals)
token: 'USDC'
});
// Execute bridge
const tx = await bridge.bridgeAsset({
quote,
fromAddress: '0x...',
toAddress: '0x...'
});Decentralized Storage
import { StorageClient } from '@varity/sdk';
const storage = new StorageClient({ clientId: 'your-id' });
// Upload file to IPFS
const file = new File(['Hello World'], 'hello.txt');
const result = await storage.uploadFile(file);
console.log('IPFS URI:', result.uri); // ipfs://...
// Download from IPFS
const blob = await storage.downloadFile({ uri: result.uri });API Monetization with x402
import { x402Client } from '@varity/sdk';
const x402 = new x402Client({ clientId: 'your-id' });
// Create pay-per-call API endpoint
const endpoint = await x402.createPaymentEndpoint({
apiUrl: 'https://api.yourapp.com/data',
pricePerCall: 10000n, // 0.01 USDC per call
paymentToken: 'USDC',
chain: varityL3
});
// Users pay with crypto, you earn 70% (thirdweb takes 30%)
console.log('Payment endpoint:', endpoint.endpointId);Version
Current version: 2.0.0-alpha.1
License
MIT - See LICENSE file
Contributing
See CONTRIBUTING.md for development guidelines.
Support
- Documentation: https://docs.varity.ai
- Discord: https://discord.gg/varity
- GitHub Issues: https://github.com/varity-labs/varity-sdk/issues
- Email: [email protected]
