> ## Documentation Index
> Fetch the complete documentation index at: https://seilabs-pr-registry-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing

> Contributing to @sei-js - Complete guide to local development setup, testing, and pull request process

## Getting Started

Welcome to the @sei-js contributor community! This guide will help you set up your local development environment and contribute to the project.

### Prerequisites

Before you begin, ensure you have:

* **nvm** (Node Version Manager)
* **Yarn** (4.7.0)

### Local Development Setup

<Steps>
  <Step title="Fork and Clone">
    1. Fork the [@sei-js repository](https://github.com/sei-protocol/sei-js) on GitHub
    2. Clone your fork locally:

    ```bash theme={null}
    git clone git@github.com:sei-protocol/sei-js.git
    cd sei-js
    ```

    <Check>
      This creates your own copy of the repository that you can modify freely.
    </Check>
  </Step>

  <Step title="Use Correct Node.js Version">
    Switch to the project's required Node.js version:

    ```bash theme={null}
    nvm use
    ```

    <Info>
      This will use Node.js v20 as specified in the project's `.nvmrc` file.
    </Info>

    <Check>
      You should see a message confirming you're now using the correct Node.js version.
    </Check>
  </Step>

  <Step title="Install Dependencies">
    Install all dependencies and link packages:

    ```bash theme={null}
    yarn install
    ```

    <Check>
      This installs dependencies for all packages in the monorepo and sets up workspace linking.
    </Check>
  </Step>

  <Step title="Build All Packages">
    Build all packages in the correct order:

    ```bash theme={null}
    	pnpm build:all
    ```

    <Check>
      This ensures all packages are built and ready for development.
    </Check>
  </Step>

  <Step title="Run Tests">
    Verify everything is working:

    ```bash theme={null}
    # Run all tests
    yarn test:all

    # Run tests with coverage report
    yarn test:coverage
    ```

    <Check>
      All tests should pass and you should see coverage reports for each package.
    </Check>

    <Info>
      Coverage reports help ensure your changes don't reduce test coverage. Look for coverage percentages in the output.
    </Info>
  </Step>

  <Step title="Run and Verify Docs">
    Start the documentation server to verify everything is set up correctly:

    ```bash theme={null}
    yarn docs
    ```

    <Info>
      This will start the documentation server at `http://localhost:3000`
    </Info>

    <Check>
      The documentation should open in your browser and display without errors.
    </Check>
  </Step>
</Steps>

## Project Structure

Understanding the monorepo structure will help you navigate and contribute effectively:

```
sei-js/
├── packages/
│   ├── create-sei/          # CLI scaffolding tool
│   ├── precompiles/         # EVM precompile contracts and integrations
│   ├── ledger/              # Ledger hardware wallet support
│   ├── registry/            # Chain and asset registry
│   ├── sei-global-wallet/   # Global wallet provider
│   └── mcp-server/          # MCP server for AI integration
├── docs/                    # Documentation site
└── ...
```

## Development Workflow

### Code Quality and Standards

We use **Biome** for code formatting and linting. Configure your IDE to use Biome for the best development experience:

```bash theme={null}
# Check your code
yarn biome check

# Auto-fix formatting and linting issues  
yarn biome check --apply
```

<Info>
  Configure your IDE to use the project's Biome configuration for automatic formatting and linting as you code.
</Info>

### Running Tests

Run tests to ensure your changes work correctly:

```bash theme={null}
# Run all tests
yarn test:all

# Run tests with coverage report
yarn test:coverage
```

<Warning>
  Always aim for **100% code coverage** in your contributions. Add comprehensive tests for any new functionality or bug fixes.
</Warning>

## Making Changes

That's it! You're ready to start contributing to @sei-js. Make your changes, test them thoroughly with the commands above, and submit your pull request when ready.
