FARTLABS
Developer tools and SDKs for building on Fartchain. Harness the power of decentralized flatulence on Solana.The smelliest blockchain in the metaverse!
Connect Your Wallet
Start building on Solana's gassiest chain
- Change wallet
Fartchain SDK for Solana
v0.69.0
The official JavaScript SDK for interacting with the Fartchain network on Solana
Installation
npm install @Fartchain/solana-sdk
Basic Usage
import { FartConnection, FartWallet } from '@Fartchain/solana-sdk'; // Initialize connection to Fartchain (Solana fork) const connection = new FartConnection('https://api.Fartchain.io'); // Connect to wallet const wallet = new FartWallet(); await wallet.connect(); // This will trigger Phantom wallet // Get FARTER Token balance const fartBalance = await connection.getFartBalance(wallet.publicKey); console.log(`Your FARTER balance: ${fartBalance}`); // Send some FARTER tokens const tx = await connection.sendFart({ fromPubkey: wallet.publicKey, toPubkey: 'GasL0rd69fartXyz123...', amount: 69.42, gasIntensity: 'spicy' // Options: 'mild', 'spicy', 'nuclear' }); // Wait for confirmation const confirmation = await connection.confirmTransaction(tx); console.log(`Transaction confirmed! Smell ID: ${confirmation.smellId}`);
Key Features
- Full Solana API support with Fartchain extensions
- Gas optimization algorithms for maximum efficiency (less beans wasted)
- Built-in Phantom wallet integration
- Solana Program interaction helpers
- TypeScript support with full type definitions
- React hooks for easy frontend integration
- Smell verification protocol (SVP) for authentic fart transactions
- Bean-to-Gas conversion utilities
- Fart intensity analyzer (measures gas potency in PPM)
- Blockchain-verified Dutch Oven certification
Solana Integration
Fartchain is built on Solana for lightning-fast and low-cost transactions. Our SDK seamlessly integrates with Phantom wallet.
// Check if Phantom is installed const isPhantomInstalled = window.solana && window.solana.isPhantom; // Connect to Phantom async function connectPhantom() { try { const resp = await window.solana.connect(); console.log("Connected to Phantom with pubkey:", resp.publicKey.toString()); return resp.publicKey; } catch (err) { console.error("Failed to connect to Phantom:", err); } } // Create a Solana transaction async function createFartTransaction(connection, fromPubkey, toPubkey, amount) { // This is where the magic happens! // Fartchain extends Solana's transaction model with smell properties const tx = await FartProgram.createTransferInstruction({ fromPubkey, toPubkey, amount, smellIntensity: 9, // 1-10 scale smellType: 'bean', // 'bean', 'egg', 'broccoli' gasReleaseRate: 'explosive' // 'slow', 'moderate', 'explosive' }); return tx; }