### Clone Solana App Kit Repository Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/setup.mdx Clones the Solana App Kit repository from Git and navigates into its root directory to prepare for further setup. ```bash git clone ... cd solana-app-kit ``` -------------------------------- ### Install Project Dependencies with Yarn Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/setup.mdx Installs all required project dependencies using the Yarn package manager, ensuring all necessary libraries and modules are available for the application. ```bash yarn install ``` -------------------------------- ### Install Solana App Kit Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/introduction.mdx This command installs the Solana App Kit library using npx, a tool for executing Node.js packages. It's the first step to integrate the kit into your React Native project. ```bash npx install solana-app-kit ``` -------------------------------- ### Start Metro Bundler Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/setup.mdx Initiates the Metro bundler, which compiles and serves the JavaScript code for the application. The '--clear' flag can be used to clear caches, but frequent use is discouraged due to potential performance impacts. ```bash yarn start --clear ``` ```bash yarn start ``` -------------------------------- ### Install iOS Pods Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/setup.mdx Navigates into the 'ios' directory of the project and installs all CocoaPods dependencies specific to the iOS application. This ensures all native iOS libraries are correctly linked. ```bash cd ios pod install ``` -------------------------------- ### Start Production Server Source: https://github.com/sendarcade/solana-app-kit/blob/main/server/README.md Initiates the production server using the 'pnpm start' command. This command typically serves the pre-built application, optimized for performance and stability. ```bash pnpm start ``` -------------------------------- ### Install Aura DAS API Backend Source: https://github.com/sendarcade/solana-app-kit/blob/main/server/src/types/aura/README.md Steps to clone the repository and install project dependencies for the Aura DAS API Backend. ```bash git clone cd aura-das-api ``` ```bash npm install ``` -------------------------------- ### Install Solana App Kit CLI Source: https://github.com/sendarcade/solana-app-kit/blob/main/README.md Installs the Solana App Kit command-line interface globally, allowing users to scaffold new projects easily. ```sh npx start-solana-app ``` -------------------------------- ### Start Backend Server in Development Mode Source: https://github.com/sendarcade/solana-app-kit/blob/main/README.md Commands to start the backend development server, allowing for local testing and development of the server-side application. ```sh pnpm dev # or yarn dev ``` -------------------------------- ### Solana App Kit: Step-by-Step Module Creation Guide Source: https://github.com/sendarcade/solana-app-kit/blob/main/CONTRIBUTING.md This guide provides step-by-step instructions for creating a new self-contained module within the Solana App Kit. It specifies the exact locations for creating module-specific folders for example flows, UI components, client-side business logic, client-side utilities, and, if needed, server-side controllers, routes, business logic, and utilities. It also covers Redux state integration, ensuring new modules are properly integrated into the existing architecture. ```APIDOC 1. In screens/common/, create a folder named after your module (e.g. screens/common/myNewModule) if you need to add example flows. 2. In src/components/, create a folder with the same name (e.g. src/components/myNewModule) and add all related UI components. 3. In src/services/, create a folder (e.g. src/services/myNewModule) for any business logic or API integration. 4. In src/utils/, create a folder (e.g. src/utils/myNewModule) for helper functions. 5. If your module requires server support, add code in: - Controllers: server/src/controllers/myNewModuleController.ts - Routes: server/src/routes/myNewModule.ts - Business Logic: server/src/service/myNewModule - Utilities: server/src/utils/myNewModule 6. If your module requires new Redux state, create or update slices in src/state/. ``` -------------------------------- ### Install Solana App Kit Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/use.mdx Instructions for installing the `solana-app-kit` library using yarn or npm in a React Native or Expo application. ```bash yarn add solana-app-kit # or npm install solana-app-kit ``` -------------------------------- ### Install and Verify CocoaPods Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/setup.mdx Installs CocoaPods, a dependency manager for iOS projects, using RubyGems. This step is crucial for managing native iOS dependencies. After installation, the version is verified. ```bash sudo gem install cocoapods pod --version ``` -------------------------------- ### Example Environment Variables Configuration (.env.example) Source: https://github.com/sendarcade/solana-app-kit/blob/main/server/README.md Provides a comprehensive example of the .env file structure, detailing various configuration parameters for general settings, Solana network, TokenMill, Google Cloud Storage, Turnkey Wallet API, Pinata IPFS, and WebSocket functionality. Placeholders indicate where actual values should be inserted. ```env # =========================================== # GENERAL CONFIGURATION # =========================================== NODE_ENV=development PORT=8080 # =========================================== # SOLANA NETWORK CONFIGURATION # =========================================== # Mainnet RPC URL (replace with your Helius API key) RPC_URL=https://staked.helius-rpc.com?api-key=YOUR_HELIUS_API_KEY # Devnet RPC URL for testing # RPC_URL=https://devnet.helius-rpc.com/?api-key=YOUR_HELIUS_API_KEY # Wallet private key for server operations (Base58 encoded) WALLET_PRIVATE_KEY=YOUR_WALLET_PRIVATE_KEY_HERE # Alternative wallet for testing # WALLET_PRIVATE_KEY=YOUR_TEST_WALLET_PRIVATE_KEY # Swap authority wallet private key SWAP_AUTHORITY_KEY=YOUR_SWAP_AUTHORITY_PRIVATE_KEY # Commission wallet address COMMISSION_WALLET=YOUR_COMMISSION_WALLET_ADDRESS # =========================================== # TOKENMILL CONFIGURATION # =========================================== # TokenMill program ID on Solana TOKEN_MILL_PROGRAMID=YOUR_TOKEN_MILL_PROGRAM_ID # TokenMill configuration PDA TOKEN_MILL_CONFIG_PDA=YOUR_TOKEN_MILL_CONFIG_PDA # Alternative config PDA for testing # TOKEN_MILL_CONFIG_PDA=YOUR_TEST_CONFIG_PDA # =========================================== # DATABASE CONFIGURATION # =========================================== # PostgreSQL connection string DATABASE_URL=postgresql://username:password@host:port/database_name # =========================================== # GOOGLE CLOUD STORAGE # =========================================== # GCS bucket name for file storage GCS_BUCKET_NAME=your-gcs-bucket-name # Service account email for GCS access SERVICE_ACCOUNT_EMAIL=your-service-account@your-project.iam.gserviceaccount.com # =========================================== # TURNKEY WALLET API # =========================================== # Turnkey API base URL TURNKEY_API_URL=https://api.turnkey.com # Your Turnkey organization ID TURNKEY_ORGANIZATION_ID=your-organization-id # Turnkey API public key TURNKEY_API_PUBLIC_KEY=your-turnkey-public-key # Turnkey API private key TURNKEY_API_PRIVATE_KEY=your-turnkey-private-key # =========================================== # PINATA IPFS CONFIGURATION # =========================================== # Pinata gateway domain PINATA_GATEWAY=your-gateway.mypinata.cloud # Pinata JWT token PINATA_JWT=your-pinata-jwt-token # Pinata API secret PINATA_API_SECRET=your-pinata-api-secret # Pinata API key PINATA_API_KEY=your-pinata-api-key # =========================================== # WEBSOCKET CONFIGURATION # =========================================== # Enable/disable WebSocket functionality WEBSOCKET_ENABLED=true ``` -------------------------------- ### Install Solana App Kit Backend Dependencies Source: https://github.com/sendarcade/solana-app-kit/blob/main/server/README.md Installs all required project dependencies for the Solana App Kit backend server using pnpm, a fast and efficient package manager. ```bash pnpm install ``` -------------------------------- ### Install Server Dependencies (pnpm) Source: https://github.com/sendarcade/solana-app-kit/blob/main/README.md Installs all required Node.js dependencies for the backend server application using the pnpm package manager. ```sh pnpm install ``` -------------------------------- ### Install Project Dependencies with pnpm Source: https://github.com/sendarcade/solana-app-kit/blob/main/README.md Installs all necessary project dependencies for the Solana App Kit using the pnpm package manager, ensuring all required libraries are available for development. ```sh pnpm install ``` -------------------------------- ### Run Development and Build Commands Source: https://github.com/sendarcade/solana-app-kit/blob/main/server/src/types/aura/README.md Commands to start the development server and build the project for deployment. ```bash npm run dev ``` ```bash npm run build ``` -------------------------------- ### Example File Structure for React Components Source: https://github.com/sendarcade/solana-app-kit/blob/main/CONTRIBUTING.md Provides a hierarchical example of how to organize React components, their associated styles, and types within a project directory, promoting modularity and maintainability. ```plaintext src/components/MyModule ├─ MyModuleMain.tsx ├─ MyModuleMain.style.ts └─ MyModuleSubComponent/ ├─ MyModuleSubComponent.tsx ├─ MyModuleSubComponent.style.ts └─ MyModuleSubComponent.types.ts ``` -------------------------------- ### Example: Create and Buy Token on Pump.fun with TypeScript Source: https://github.com/sendarcade/solana-app-kit/blob/main/docs/references/services/pumpfun/pumpfunService/functions/createAndBuyTokenViaPumpfun.mdx Provides a TypeScript example demonstrating how to invoke the `createAndBuyTokenViaPumpfun` function. It shows how to pass the necessary parameters and log the resulting mint public key. ```typescript const result = await createAndBuyTokenViaPumpfun({ userPublicKey: wallet.publicKey, tokenName: "My Test Token", tokenSymbol: "TEST", description: "A token for testing", imageUri: "file:///data/user/0/com.example/cache/ImagePicker/image.png", solAmount: 0.1, solanaWallet: wallet }); console.log(`Created token: ${result.mintPublicKey}`); ``` -------------------------------- ### TokenMillService: Programmatic Solana Token Market & Bonding Curve Setup (TypeScript) Source: https://github.com/sendarcade/solana-app-kit/blob/main/src/modules/token-mill/README.md This TypeScript example showcases direct interaction with the `TokenMillService` to programmatically create a new token market and configure its bonding curve. It demonstrates importing key functions like `createMarket` and `setBondingCurve`, passing essential parameters such as token details, user public key, connection, and wallet for on-chain operations. ```typescript import { createMarket, fundUserWithWSOL, stakeTokens, swapTokens, setBondingCurve } from '@/modules/token-mill'; // Create a new market const market = await createMarket({ tokenName: 'My Token', tokenSymbol: 'MTK', metadataUri: 'https://...', totalSupply: 1_000_000, creatorFee: 2.5, stakingFee: 1.0, userPublicKey: publicKey, connection, solanaWallet: wallet }); // Configure bonding curve await setBondingCurve({ marketAddress: market.address, askPrices: [...], bidPrices: [...], userPublicKey: publicKey, connection, solanaWallet: wallet }); ``` -------------------------------- ### TypeScript Example: Defining Constants and Main Configuration Source: https://github.com/sendarcade/solana-app-kit/blob/main/src/shared/config/README.md Provides a TypeScript example demonstrating the definition of application constants in `constants.ts` (e.g., `API_TIMEOUT`, `FEATURES`). It then shows how `index.ts` aggregates these and environment variables into a central `CONFIG` object, allowing for overrides and structured settings. ```typescript // constants.ts export const API_TIMEOUT = 30000; // 30 seconds export const MAX_RECONNECT_ATTEMPTS = 5; export const DEFAULT_AVATAR = '/assets/default-avatar.png'; // Feature flags export const FEATURES = { SOCIAL_FEED: true, NFT_GALLERY: true, CHAT: process.env.NODE_ENV === 'development', }; // index.ts export const CONFIG = { // API configuration API_URL: process.env.REACT_APP_API_URL || 'https://api.example.com', SOLANA_RPC_URL: process.env.REACT_APP_SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com', // Feature toggles FEATURES: { ...FEATURES, // Override from environment if provided ...(process.env.REACT_APP_FEATURES ? JSON.parse(process.env.REACT_APP_FEATURES) : {}), }, // Connection settings CONNECTION: { TIMEOUT: API_TIMEOUT, MAX_RETRIES: 3, }, }; ``` -------------------------------- ### React Native Solana NFT Listing Component Example Source: https://github.com/sendarcade/solana-app-kit/blob/main/src/modules/nft/README.md Illustrates a simplified React Native component (`SellSection`) demonstrating the process of fetching and displaying a user's NFTs. It outlines the typical application flow, from screen activation and wallet integration to data fetching via an NFT service (e.g., Tensor API) and preparing NFTs for sale. The example uses `useFetchNFTs` and `FlatList` for rendering. ```typescript // Simplified example within SellSection.tsx import React, { useState, useEffect, useCallback } from 'react'; import { View, Text, FlatList, Button } from 'react-native'; import { useFetchNFTs } from '@/modules/nft'; // Assuming index exports this import { NftItem } from '@/modules/nft/types'; interface SellSectionProps { userPublicKey: string; // ... other props like userWallet } const SellSection: React.FC = ({ userPublicKey }) => { const { nfts, loading, error } = useFetchNFTs(userPublicKey); const [selectedNft, setSelectedNft] = useState(null); // ... (logic for listing modal and handleSellNftOnTensor) if (loading) return Loading your NFTs...; if (error) return Error: {error}; return ( item.mint} renderItem={({ item }) => ( {item.name} {item.image && }