Skip to content

suda200/aptos-wave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

🌊 Surfboard: Type-Safe SDK & CLI for Aptos Development

Download

πŸš€ Overview

Surfboard is an advanced, type-safe development platform for building on the Aptos blockchain. Imagine a surfboard that doesn't just float on the water but understands the ocean's currents, predicts wave patterns, and adapts to your riding styleβ€”that's Surfboard for Aptos development. We provide intelligent interfaces, reactive hooks, and a powerful CLI that transforms blockchain interaction from a technical chore into a fluid, intuitive experience.

Built with TypeScript from the seafloor up, Surfboard offers compile-time safety, runtime confidence, and developer ergonomics that make building decentralized applications feel like catching the perfect wave.

πŸ“¦ Installation

Prerequisites

  • Node.js 18+ or Bun 1.0+
  • Aptos CLI (optional, for full feature set)
  • TypeScript 5.0+ (recommended)

Quick Start

# Install via npm
npm install @surfboard/aptos

# Or using Bun
bun add @surfboard/aptos

# Install CLI globally
npm install -g @surfboard/cli

Download the complete package: Download

πŸ„β€β™‚οΈ Core Philosophy

Most blockchain SDKs are like giving developers a toolbox and pointing them toward the ocean. Surfboard is differentβ€”we provide the board, the wetsuit, the tide charts, and a personal coach. Our approach centers on three principles:

  1. Type-Safety as a First-Class Citizen: Every interaction, from contract calls to transaction building, is fully typed
  2. Reactive by Design: Our hooks and observers respond to blockchain state changes automatically
  3. Context-Aware Intelligence: The SDK understands deployment environments, network conditions, and gas patterns

πŸ—οΈ Architecture

graph TB
    A[Developer Application] --> B[Surfboard Core SDK]
    B --> C[Type-Safe Interfaces]
    B --> D[Reactive Hooks]
    B --> E[Smart Contract Adapters]
    
    C --> F[Aptos Blockchain]
    D --> F
    E --> F
    
    G[Surfboard CLI] --> H[Project Scaffolding]
    G --> I[Contract Deployment]
    G --> J[State Monitoring]
    
    H --> A
    I --> F
    J --> F
    
    K[AI Integration Layer] --> L[OpenAI API]
    K --> M[Claude API]
    K --> B
    
    style B fill:#4a90e2
    style G fill:#50e3c2
    style K fill:#b8e986
Loading

✨ Key Features

πŸ›‘οΈ Type-Safe Everything

  • Complete Move ABIs automatically converted to TypeScript interfaces
  • Transaction builders with compile-time parameter validation
  • Event filters with typed payloads and automatic decoding
  • Resource accessors that understand your contract's state structure

πŸ”„ Reactive State Management

  • useAptosAccount(): React hook for wallet state with automatic reconnection
  • useContractState(): Real-time monitoring of contract variables
  • Transaction observers: Promise-based transaction lifecycle tracking
  • Multi-network support: Switch between devnet, testnet, and mainnet seamlessly

🧠 Intelligent Development Tools

  • AI-assisted code generation: Describe your contract in plain English, get typed interfaces
  • Gas optimization suggestions: Real-time analysis of transaction patterns
  • Error prediction: Common pitfalls detected before transaction submission
  • Contract simulation: Dry-run transactions with detailed outcome analysis

🌐 Universal Compatibility

Platform Status Notes
πŸͺŸ Windows βœ… Fully Supported WSL2 recommended for CLI tools
🍎 macOS βœ… Native Support ARM and Intel architectures
🐧 Linux βœ… Optimal Experience All distributions supported
🐳 Docker βœ… Container Ready Official images available
☁️ Cloud IDEs βœ… Browser Compatible Gitpod, Codespaces, StackBlitz

πŸ“ Example Profile Configuration

Create a .surfboardrc file in your project root:

# Surfboard Configuration Profile
version: "2026.1.0"

project:
  name: "wave_runner_dapp"
  type: "react-move"
  packageManager: "bun"

networks:
  default: "testnet"
  endpoints:
    testnet: "https://fullnode.testnet.aptoslabs.com/v1"
    mainnet: "https://fullnode.mainnet.aptoslabs.com/v1"
    local: "http://localhost:8080/v1"

ai:
  enabled: true
  providers:
    - name: "openai"
      model: "gpt-4-turbo"
      role: "code_generation"
    - name: "claude"
      model: "claude-3-opus-20240229"
      role: "security_analysis"
  
  # Budget controls for AI features
  monthlyCreditLimit: 1000
  autoApproveUnder: 5

codegen:
  strict: true
  emitHooks: true
  includeTests: true
  formatter: "prettier"

deployment:
  autoVerify: true
  optimizer:
    enabled: true
    level: "aggressive"
  gasTank:
    enabled: true
    refillThreshold: "0.5 APT"

ui:
  theme: "surf"
  responsiveBreakpoints:
    mobile: 640
    tablet: 1024
    desktop: 1280
  multilingual:
    default: "en"
    supported: ["en", "es", "zh", "ja", "ko"]
    autoDetect: true

support:
  mode: "hybrid"
  channels:
    - "documentation"
    - "community_forum"
    - "priority_slack"
  responseTime:
    standard: "24h"
    priority: "4h"
    critical: "1h"

🚀 Example Console Invocation

# Initialize a new Surfboard project
surfboard init wave-runner --template react-move --network testnet

# Generate typed interfaces from a Move contract
surfboard generate-interfaces ./contracts/WaveRunner.move --output ./src/types/

# Deploy with AI-assisted optimization
surfboard deploy ./contracts --network testnet --ai-optimize --simulate-first

# Start a development environment with hot reload
surfboard dev --port 3000 --open --monitor

# Analyze gas patterns across transactions
surfboard analyze-gas ./transactions/*.json --output report.html

# Generate multilingual documentation
surfboard docs generate --lang en,es,zh --format md,html

# Connect to AI code assistant
surfboard ai prompt "Create a hook for staking with cooldown periods"

🧩 Integration Examples

React Component with Surfboard Hooks

import { useAptosAccount, useContract, useTransaction } from '@surfboard/aptos';
import { WaveRunner } from './types/WaveRunner'; // Auto-generated types

export const StakeInterface: React.FC = () => {
  const { account, connect, isConnected } = useAptosAccount();
  const contract = useContract(WaveRunner, '0x1234...');
  
  const stakeTx = useTransaction(async (amount: number) => {
    // Fully typed transaction builder
    return contract.stake({
      amount: contract.types.u64(amount),
      duration: contract.types.u64(30) // days
    });
  }, {
    onSuccess: (result) => {
      console.log('Staked successfully:', result.hash);
    },
    onError: (error) => {
      console.error('Staking failed:', error.message);
    }
  });

  return (
    <div className="responsive-staking-ui">
      <h2>πŸ„β€β™€οΈ Ride the Wave</h2>
      {!isConnected ? (
        <button onClick={connect}>Connect Wallet</button>
      ) : (
        <StakeForm 
          onSubmit={stakeTx.execute}
          isPending={stakeTx.isPending}
          maxAmount={account.balance}
        />
      )}
      
      {/* Multilingual support built-in */}
      <LanguageSelector />
      
      {/* Real-time support access */}
      <SupportWidget priority="standard" />
    </div>
  );
};

AI-Assisted Development

import { AICodeAssistant } from '@surfboard/ai';

const assistant = new AICodeAssistant({
  providers: ['openai', 'claude'],
  context: 'aptos_move_development'
});

// Generate a complete contract from description
const contractCode = await assistant.generateContract(`
  Create a liquidity pool contract with:
  - Two token types (APT and a stablecoin)
  - Constant product formula (x*y=k)
  - 0.3% swap fee
  - Liquidity provider rewards
  - Include events for all major actions
`);

// Get security analysis
const auditReport = await assistant.auditContract(contractCode, {
  checks: ['reentrancy', 'overflow', 'access_control']
});

// Generate corresponding frontend hooks
const frontendHooks = await assistant.generateHooks(contractCode, {
  framework: 'react',
  include: ['useSwap', 'useAddLiquidity', 'usePoolStats']
});

πŸ”‘ SEO-Optimized Keywords

Surfboard enables type-safe Aptos development with reactive blockchain hooks and AI-assisted smart contract creation. Our platform provides enterprise-grade Move language support with real-time transaction monitoring and multilingual documentation generation. Developers achieve rapid dApp deployment with gas optimization intelligence and cross-platform compatibility across Windows, macOS, and Linux environments.

πŸ€– AI Integration

OpenAI API Integration

  • Code generation: GPT-4 Turbo for contract and interface creation
  • Documentation: Automatic generation of usage examples and API docs
  • Error explanation: Natural language descriptions of transaction failures
  • Code translation: Convert between Move versions or to other languages

Claude API Integration

  • Security analysis: Deep contract auditing with vulnerability detection
  • Architecture review: High-level system design recommendations
  • Best practices: Context-aware coding standards enforcement
  • Complex logic verification: Mathematical proof checking for DeFi protocols

Hybrid AI Strategy

Surfboard employs a dual-AI approach where OpenAI handles creative generation tasks while Claude focuses on analytical and security-critical functions. This combination provides both innovation and reliability.

🌍 Multilingual Support

Surfboard includes built-in internationalization for:

  • Developer documentation in 12 languages
  • CLI output with locale-aware formatting
  • Error messages translated for global teams
  • UI components with automatic text extraction
  • Contract comments that can be authored in native languages

πŸ“ž 24/7 Development Support

Our support system operates on a tiered model:

  1. Documentation & Community: Comprehensive guides and community forums
  2. Priority Slack: Direct access to core maintainers for active projects
  3. Emergency Response: Critical issue resolution within 1 hour
  4. Architecture Review: Scheduled consultations for complex implementations

All support channels are available regardless of timezone, with follow-the-sun coverage across our global team.

πŸ† Competitive Advantages

Beyond Type Safety

While type safety is our foundation, Surfboard extends further with:

  • Intent-based development: Describe what you want, get working code
  • Contextual adaptation: SDK behavior adjusts based on project phase
  • Predictive analytics: Anticipate network conditions and gas prices
  • Collaborative features: Multi-developer state synchronization

The Responsive Advantage

Our UI components automatically adapt to:

  • Device capabilities: Mobile, tablet, desktop, and embedded systems
  • Network conditions: Offline mode, slow connection optimizations
  • User preferences: Theme, language, and interaction patterns
  • Regulatory contexts: Jurisdiction-specific interface variations

⚠️ Disclaimer

Surfboard SDK & CLI (2026 Edition) - Usage Agreement

Surfboard is provided as a development acceleration tool for the Aptos blockchain. While we implement extensive testing, security reviews, and AI-assisted validation, users acknowledge that:

  1. Blockchain development involves inherent risks including financial loss, security vulnerabilities, and regulatory considerations
  2. AI-generated code should be reviewed by qualified developers before production use
  3. Surfboard Labs is not liable for losses resulting from software bugs, security breaches, or incorrect AI suggestions
  4. Users are responsible for compliance with local laws and regulations
  5. The Aptos blockchain and its ecosystem components are independent projects
  6. All AI features consume third-party API credits subject to separate terms
  7. Support response times are targets, not guarantees, for non-critical issues

Always conduct independent audits, security reviews, and testing before deploying to production environments. Start with testnet deployments and gradually increase value exposure.

πŸ“„ License

Surfboard is released under the MIT License. See the LICENSE file for complete details.

Key permissions:

  • βœ… Commercial use
  • βœ… Modification
  • βœ… Distribution
  • βœ… Private use
  • βœ… Patent use

Requirements:

  • πŸ“ License and copyright notice preservation
  • πŸ“ Same license for substantial portions

Limitations:

  • ⚠️ No liability
  • ⚠️ No warranty

🚒 Getting Started Package

Ready to catch the perfect development wave? Download the complete Surfboard package including SDK, CLI tools, example projects, and documentation:

Download


Surfboard (2026 Edition) – Where Aptos development meets the flow state. Built by developers, for developers, with an eye toward the horizon of what blockchain interfaces can become.

About

Type-Safe Aptos SDK 2026 πŸš€ - React Hooks & Utilities

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors