-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Implements staking functionality #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ad50ec5
feat: Implements staking functionality
MuncleUscles 0b120f3
Refactors network configuration handling
MuncleUscles f2c5ae5
Feat(account): Adds account import command
MuncleUscles 51340fd
fix: tests
MuncleUscles 8a26ae1
feat: upgrades genlayer-js to v0.18.5
MuncleUscles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Build & Development | ||
|
|
||
| ```bash | ||
| npm install # Install dependencies | ||
| npm run dev # Watch mode development build (uses esbuild) | ||
| npm run build # Production build | ||
| node dist/index.js # Run CLI from source | ||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| ```bash | ||
| npm test # Run all tests (vitest) | ||
| npm run test:watch # Watch mode | ||
| npm run test:coverage # Coverage report | ||
| npx vitest tests/commands/deploy.test.ts # Single test file | ||
| npx vitest -t "test name pattern" # Run specific test by name | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Entry Point & Command Structure | ||
| - `src/index.ts` - Main entry, initializes Commander program and registers all command groups | ||
| - Commands organized in `src/commands/<domain>/index.ts` - each exports `initialize*Commands(program)` function | ||
| - Command domains: general (init/up/stop), account, contracts, config, localnet, update, scaffold, network, transactions, staking | ||
|
|
||
| ### Core Classes | ||
| - `BaseAction` (`src/lib/actions/BaseAction.ts`) - Base class for all CLI actions. Provides: | ||
| - GenLayer client initialization via `genlayer-js` SDK | ||
| - Keystore management (encrypted wallet with password) | ||
| - Spinner/logging utilities (ora, chalk) | ||
| - User prompts (inquirer) | ||
| - `ConfigFileManager` (`src/lib/config/ConfigFileManager.ts`) - Manages `~/.genlayer/genlayer-config.json` | ||
| - `KeychainManager` (`src/lib/config/KeychainManager.ts`) - System keychain integration via keytar | ||
|
|
||
| ### Pattern for Adding Commands | ||
| 1. Create action class extending `BaseAction` in `src/commands/<domain>/<action>.ts` | ||
| 2. Export action options interface | ||
| 3. Register in domain's `index.ts` via Commander | ||
| 4. Add tests in `tests/commands/<domain>.test.ts` and `tests/actions/<action>.test.ts` | ||
|
|
||
| ### External Dependencies | ||
| - `commander` - CLI framework | ||
| - `genlayer-js` - GenLayer SDK for blockchain interactions | ||
| - `ethers` - Wallet/keystore encryption | ||
| - `dockerode` - Docker management for localnet | ||
| - `viem` - Ethereum utilities | ||
|
|
||
| ### Path Aliases | ||
| - `@/*` → `./src/*` | ||
| - `@@/tests/*` → `./tests/*` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space in usage syntax on Line 214.
The usage line for the
sendcommand is missing a space, making it harder to read and inconsistent with the format of other commands.📝 Committable suggestion
🤖 Prompt for AI Agents