Skip to content

📚 Add Comprehensive API Documentation #39

@Mosas2000

Description

@Mosas2000

Description

The project lacks documentation for contract functions, frontend hooks, and integration guides for developers.

Current Documentation

  • README.md - Basic overview
  • DEVELOPMENT.md - Brief development guide
  • docs/ folder exists but contents not reviewed

Required Documentation

1. Smart Contract Documentation

market-core.clar

Function Parameters Returns Description
create-market question, duration market-id Creates new prediction market
predict market-id, outcome, amount bool Places a prediction
claim-winnings market-id payout Claims winning stake

oxcast.clar (MVP Contract)

  • Token functions (SIP-010)
  • Staking functions
  • Market functions

2. Frontend Hooks Documentation

/**
 * useMarkets - Fetches all markets from the contract
 * @returns {Object} { markets, isLoading, error, refetch }
 * @example
 * const { markets, isLoading } = useMarkets();
 */

3. Integration Guide

  • How to connect wallet
  • How to place predictions
  • How to create markets
  • How to claim winnings

4. API Reference

  • Hiro API endpoints used
  • Rate limits
  • Response formats

Files to Create

  • docs/contracts/market-core.md
  • docs/contracts/oxcast.md
  • docs/contracts/governance.md
  • docs/frontend/hooks.md
  • docs/frontend/components.md
  • docs/integration-guide.md
  • docs/api-reference.md

Priority

🟢 Low - Important for open source contribution

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions