Add CLI tool for adapter template generation #646
+1,049
−1
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.
Summary
Added an interactive CLI tool to auto-generate pegged asset adapter boilerplate
What's New
Command:
Two modes:
Generates:
index.ts - Properly configured adapter
README.md - Complete documentation
Key Features
✅ supports all chains in chain.json
✅ 18 peg types (USD, EUR, GBP, etc.)
✅ Minted/bridged token handling
✅ Reserve address configuration
✅ Duplicate adapter detection
Files Changed
Benefits
For Contributors:
For Maintainers:
Testing
Tested with:
Single/multi-chain adapters ✓
All peg types ✓
Minted/bridged configurations ✓
Reserve addresses ✓
Edge cases (duplicates) ✓
Example Output
Generated index.ts:
import { addChainExports } from "../helper/getSupply"; const chainContracts = { ethereum: { issued: ["0x..."] }, bsc: { bridgedFromETH: ["0x..."] } }; const adapter = addChainExports(chainContracts, undefined, { pegType: "peggedUSD", decimals: 18, }); export default adapter;Documentation
Quick start in main README
Detailed guide: src/cli/CREATE_ADAPTER_GUIDE.md
Built-in help: npm run create-adapter -- --help
Type: Feature (Tooling)
Breaking Changes: None
Branch: feat/cli-adapter-template-generator