@gala-chain/launchpad-mcp-server
Version:
MCP server for Gala Launchpad - 102 tools (pool management, event watchers, GSwap DEX trading, price history, token creation, wallet management, DEX pool discovery, liquidity positions, token locks, locked token queries, composite pool data, cross-chain b
1,275 lines (933 loc) • 85.1 kB
Markdown
# Changelog
## 1.25.0
### Minor Changes
- Add event watcher tools for real-time pool and token discovery:
**New MCP Tools:**
- `gala_launchpad_on_dex_pool_creation` - Watch for new DEX pool creation with filtering
- Parameters: minTVL (optional), tokens (optional), intervalMs (optional), durationSeconds
(optional)
- Returns: poolsDetected count, durationSeconds, and array of detected pools
- `gala_launchpad_on_launchpad_token_creation` - Watch for new launchpad token creation with
filtering
- Parameters: creatorAddress (optional), intervalMs (optional), durationSeconds (optional)
- Returns: tokensDetected count, durationSeconds, and array of detected tokens
**Updates:**
- Tool registry updated from 74 to 76 tools
- Pool tools category increased from 17 to 19 tools
- Updated SDK dependency to @gala-chain/launchpad-sdk@^3.29.0
🧠 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
### Patch Changes
- Updated dependencies
- @gala-chain/launchpad-sdk@3.29.0
## 1.24.1
### Patch Changes
- fix: Update tool registry validation count from 72 to 74
- Fixed hard-coded tool count validation that was preventing v1.24.0 from starting
- Updated from 72 tools to 74 tools to account for 2 new DEX pool discovery tools
- Updated registry documentation to reflect correct tool distribution
## 1.24.0
### Minor Changes
- feat: Add DEX Pool Discovery MCP tools and prompts
- 2 new MCP tools: `gala_launchpad_fetch_dex_pools`, `gala_launchpad_fetch_all_dex_pools`
- 2 new slash commands: `/fetch-dex-pools`, `/fetch-all-dex-pools`
- Full support for GalaSwap liquidity pool exploration via MCP
- Integration with new SDK v3.28.0 DEX Pool Discovery feature
- Complete test coverage with 586 tests passing
## 1.23.0
### Minor Changes
- 2bab95b: feat: Add 50 new slash commands to achieve complete 1:1 MCP tool-to-command mapping
Complete implementation of user requirement: "every MCP tool should have a corresponding slash
command."
## Changes
### New Slash Commands (50 total)
**Pool Management (15 commands):**
- fetch-pools, fetch-all-pools, fetch-pool-details, fetch-pool-details-for-calculation
- fetch-token-details, fetch-token-distribution, fetch-token-badges, fetch-volume-data
- fetch-gala-spot-price, fetch-token-spot-price, fetch-launchpad-token-spot-price
- fetch-price-history, fetch-all-price-history
- check-token-name, check-token-symbol, resolve-vault-address, resolve-token-class-key
**Trading Calculations (11 commands):**
- calculate-buy-amount, calculate-sell-amount, fetch-trades, calculate-initial-buy
- get-bundler-transaction-result, calculate-graduation-cost
- calculate-buy-amount-local, calculate-buy-amount-external
- calculate-sell-amount-local, calculate-sell-amount-external
- is-token-graduated
**Balance & Portfolio (4 commands):**
- fetch-gala-balance, fetch-token-balance, fetch-tokens-created, update-profile
**Creation Utilities (3 commands):**
- upload-profile-image, upload-token-image, fetch-launch-token-fee
**Social & Comments (2 commands):**
- post-comment, fetch-comments
**Token Transfers (2 commands):**
- transfer-gala, transfer-token
**Utility & System (12 commands):**
- create-wallet, get-address, get-ethereum-address, get-config
- get-url-by-token-name, explain-sdk-usage, get-cache-info, clear-cache
- has-wallet, get-wallet, set-wallet, get-environment
### Tool Constants
**Updated `src/constants/mcpToolNames.ts`:**
- Added 14 new tool constants to POOL_TOOLS (moved FETCH_TOKEN_DETAILS, FETCH_PRICE_HISTORY,
FETCH_ALL_PRICE_HISTORY, and resolved vault/token class key tools)
- Expanded UTILITY_TOOLS from 6 to 14 tools (added cache management, wallet management,
environment/version tools)
- Updated comments to reflect "72 tools across 8 categories"
### New Prompt Files
Created 7 new prompt files with comprehensive handler functions:
- `src/prompts/pools.ts` - Pool management commands
- `src/prompts/trading-calculations.ts` - Trading calculation commands
- `src/prompts/balances.ts` - Balance query commands
- `src/prompts/creation-utils.ts` - Creation utility commands
- `src/prompts/social.ts` - Social/comments commands
- `src/prompts/transfers.ts` - Token transfer commands
- `src/prompts/utility-tools.ts` - Utility and system commands
### Documentation Updates
**Updated `packages/mcp-server/README.md`:**
- Updated tool count from 70 to 72 across all sections
- Updated slash command count from 23 to 72 (was only 18 original commands + 24 new ones = 42
documented, now 72 total)
- Added comprehensive documentation for all 48 new slash commands organized by category
- Added emphasis on "1:1 tool-to-command mapping" - core design philosophy
- Complete tool listings now include all utility tools (cache, wallet, environment management)
### Architecture Achievement
The implementation completes the core design goal: **Every MCP tool now has exactly one
corresponding slash command**, enabling users to interact with all backend functionality through
the familiar slash command interface.
**Tool-to-Command Mapping:**
- 72 MCP tools → 72 slash commands (perfect 1:1 ratio)
- 9 tool categories → 9 command category sections in documentation
- Consistent naming patterns for easy discovery (tool names match command names)
### Code Organization Improvements
**Updated MCP_TOOLS spread operator order in `src/constants/mcpToolNames.ts`:**
- Reordered to place UTILITY_TOOLS before DEX_TOOLS and LIQUIDITY_TOOLS
- New order: POOL → TRADING → BALANCE → CREATION → SOCIAL → TRANSFER → UTILITY → DEX → LIQUIDITY
- Improves code consistency and follows logical category ordering
### Validation Improvements
Fixed validation function calls in all new prompt files to use correct function signatures:
- `validateTokenName(name, fieldName)` - Added fieldName parameter
- `validateAddress(address, fieldName)` - Added fieldName parameter
- `validateNumericAmount(amount, fieldName)` - Added required fieldName parameter
- Improved error messages when validation fails
### Test Coverage
All tests passing:
- TypeScript compilation: 0 errors
- Jest test suite: 1401 tests across 30 test suites
- ESLint: 0 linting issues
- Registry tests: Validates all 72 prompts are registered and discoverable
## Why This Matters
User's explicit requirement: _"why would a functionality be worth of a 'tool' that the mcp can
use, but not a / command I can use? It just seems like slashes should be mainly for exposing mcp
tools for quick consumption"_
This implementation fulfills that philosophy by ensuring complete parity between available tools
and available commands. Users never encounter a capability they can't access from the slash
command interface.
## 1.22.4
### Patch Changes
- 096a518: feat: add environment switching tools, prompts, and comprehensive test coverage for MCP
server
**New Tools:**
- Added gala_launchpad_get_environment tool to query current environment (production, development,
or testing)
- Added gala_launchpad_switch_environment tool to dynamically switch environments while preserving
wallet configuration
**New Prompts:**
- Added /galachain-launchpad:switch-environment slash command for guided environment switching
workflow
**Enhancements:**
- Enhanced gala_launchpad_get_config to include mcpServerEnvironment field showing current
environment state
- Implemented server-level tool support via new createServerLevelTool factory function
- Updated MCP tool handler signature to accept optional server parameter (backward compatible)
- Modified LaunchpadMCPServer to track currentEnvironment and currentPrivateKey state
- Added switchEnvironment() and getEnvironment() methods to LaunchpadMCPServer class with
fail-safe error handling
**Bug Fixes:**
- Fixed version mismatch in server.ts: now uses dynamically injected MCP_SERVER_VERSION instead of
hardcoded value
- Fixed error handling in switchEnvironment(): now creates new SDK before destroying old one to
prevent broken state on failure
**Tests:**
- Added 23 comprehensive server contract tests covering environment switching, state management,
error handling, and type safety
- Updated prompt registry tests to reflect 24 prompts (was 23)
- All 278 MCP server unit tests passing (was 255), total suite 1401+ tests
**Documentation:**
- Updated tool registry documentation: 72 tools total (pools: 17, trading: 13, dex: 13, balance:
6, creation: 4, social: 2, transfers: 2, utils: 15)
- Updated CLAUDE.md with comprehensive environment switching documentation
## 1.22.3
### Patch Changes
- fix: return raw price impact values with full precision instead of rounding to 2 decimals
Changed price impact return format from `.toFixed(2)` to `.toString()` to preserve the full
precision of GSwap SDK's price impact calculations. This allows consumers to see the actual price
impact values without rounding loss.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.27.3
## 1.22.2
### Patch Changes
- fix: use GSwap SDK's native price impact calculation instead of custom formula
The custom price impact calculation was inaccurate. The GSwap SDK already provides a correct
`priceImpact` field in its quote responses that accounts for the actual exchange rate and pool
slippage. We now use that directly instead of computing our own formula.
This fixes issues where small swaps incorrectly showed 0% impact and large swaps showed incorrect
values.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.27.2
## 1.22.1
### Patch Changes
- Redeploy with latest price impact fix
- Updated dependencies
- @gala-chain/launchpad-sdk@3.27.1
## 1.22.0
### Minor Changes
- 0a49faf: **GalaSwap Liquidity Position Management (v3.25.0 SDK / v1.20.0 MCP)**
Comprehensive liquidity position management for concentrated liquidity provision on GalaSwap DEX.
Liquidity providers can now earn passive trading fees by providing liquidity within specific price
ranges.
### 8 New SDK Methods (LaunchpadSDK)
1. **getSwapUserLiquidityPositions(ownerAddress, limit?, bookmark?)** - View all open positions
for a wallet with pagination support
2. **getSwapLiquidityPositionById(ownerAddress, positionId)** - Get specific position by UUID
3. **getSwapLiquidityPosition(ownerAddress, position)** - Get position by token pair and tick
range
4. **addSwapLiquidityByPrice(args)** - Create position using user-friendly price ranges (e.g.,
min: 0.95, max: 1.05)
5. **addSwapLiquidityByTicks(args)** - Create position using precise tick boundaries (advanced)
6. **getSwapEstimateRemoveLiquidity(args)** - Preview amounts and fees before executing removal
7. **removeSwapLiquidity(args)** - Close or reduce position with slippage protection
8. **collectSwapPositionFees(args)** - Harvest accumulated trading fees without closing position
### 8 New MCP Tools
All SDK methods exposed as MCP tools with full type validation and privateKey override support:
- `gala_launchpad_get_user_liquidity_positions` - List positions with pagination
- `gala_launchpad_get_liquidity_position_by_id` - Get by position ID
- `gala_launchpad_get_liquidity_position` - Get by token pair
- `gala_launchpad_add_liquidity_by_price` - Create position (price-based)
- `gala_launchpad_add_liquidity_by_ticks` - Create position (tick-based)
- `gala_launchpad_estimate_remove_liquidity` - Estimate removal amounts
- `gala_launchpad_remove_liquidity` - Execute removal
- `gala_launchpad_collect_position_fees` - Collect accumulated fees
### 4 New Slash Commands (Prompts)
Quick-access workflows for Claude Desktop users:
- `/galachain-launchpad:my-positions` - View all liquidity positions
- `/galachain-launchpad:add-liquidity` - Create new position (guided workflow)
- `/galachain-launchpad:remove-liquidity` - Close position (with estimates)
- `/galachain-launchpad:collect-fees` - Harvest accumulated fees
### Key Features
**Fee Tiers**: Support for standard GalaSwap fee tiers (500 bps = 0.05%, 3000 bps = 0.30%, 10000
bps = 1.00%)
**Price Range Creation**: User-friendly price range interface (0.95 - 1.05) automatically converts
to precise tick boundaries
**Tick-Based Creation**: Advanced users can create positions using exact tick boundaries for
precise capital management
**Fee Collection**: Harvest passive trading fees without closing position
**Estimation**: Preview exact amounts and fees before executing any transaction
**Slippage Protection**: Built-in slippage tolerance for all operations
**Pagination**: Efficient position listing with bookmark support for large portfolios
### Documentation & Examples
- **Demo Script**: `packages/sdk/examples/demo-liquidity-positions.ts` - Complete workflow
demonstration
- **SDK Docs**: `explain_sdk_usage` tool includes `liquidity-positions` topic with runnable
examples
- **Integration Guide**: CLAUDE.md includes comprehensive LP integration section
### Test Coverage
- **54 SDK Unit Tests**: Complete test coverage for all 8 methods with edge cases
- **39 MCP Tool Tests**: Full validation of all 8 MCP tools and input schemas
- **1401 Total Tests**: Full regression test suite passing
### Version Updates
- SDK: 3.24.2 → 3.25.0 (minor version bump)
- MCP Server: 1.19.2 → 1.20.0 (minor version bump)
### Patch Changes
- Updated dependencies [0a49faf]
- Updated dependencies
- @gala-chain/launchpad-sdk@3.27.0
## 1.19.0
### Minor Changes
- 683396d: **New Slash Commands for Token Creation & Discovery (v1.19.0)**
Added two powerful new slash commands to the MCP server for guided token workflows:
### `/galachain-launchpad:create-token` - Token Creation Workflow
- **Purpose**: Guided, step-by-step token creation with validation and image upload
- **Arguments**:
- `tokenName` (required) - 3-20 alphanumeric characters with hyphens/underscores
- `tokenSymbol` (required) - 1-8 uppercase letters only
- `description` (required) - Token description
- `websiteUrl`, `twitterUrl`, `telegramUrl` (optional) - Social links (at least one required)
- `imagePath` (optional) - Path to token image file
- `preBuyGala` (optional) - Pre-buy amount in GALA
- **Validation**: Token name/symbol availability, URL format validation, required social links
- **Workflow Steps**:
1. Validate token name and symbol
2. Check name/symbol availability
3. Upload token image (optional)
4. Calculate pre-buy token quantity
5. Display launch fee
6. Guide through transaction execution
### `/galachain-launchpad:discover-tokens` - Token Discovery & Filtering
- **Purpose**: Discover and filter tokens with advanced search capabilities
- **Arguments**:
- `type` (optional) - Filter type: `recent` (default), `popular`, or `near-graduation`
- `limit` (optional, default: 10) - Max results (1-50)
- `minProgress` (optional) - Minimum graduation progress percentage (0-100)
- `maxPrice` (optional) - Maximum USD price filter
- **Use Cases**:
- Find new tokens: `type=recent limit=20`
- Find trending tokens: `type=popular limit=10`
- Find near-graduation pools: `type=near-graduation minProgress=85 limit=10`
- Find cheap tokens: `maxPrice=1.00 limit=20`
- **Workflow Steps**:
1. Filter pools by type and criteria
2. Calculate graduation progress for each
3. Fetch current prices
4. Display sortable results with metrics
5. Provide links for detailed analysis
### Implementation Details
- **Total Prompts**: 18 slash commands (4 trading, 5 portfolio, 6 analysis, 2 creation/discovery,
1 utility)
- **Test Coverage**: Updated all prompt structure and registry tests to validate 18 commands
- **Validation**: Comprehensive input validation for all arguments with clear error messages
- **Documentation**: Full documentation in README.md and CLAUDE.md with usage examples
### Test Results
- ✅ 146 unit tests passing
- ✅ All prompt structure validations passing
- ✅ Backward compatible with existing slash commands
- ✅ Build verification complete
### What's Included
- New prompt definitions with full argument validation
- Workflow template generation for both commands
- Integration with existing MCP tools
- Comprehensive documentation and examples
- 683396d: # v3.23.0: GalaSwap DEX Integration & Documentation
**🚀 Major Feature Release: Complete GalaSwap DEX Integration**
## Features
### GalaSwap DEX Trading Integration (v3.23.0+)
**5 New High-Level SDK Methods for DEX Trading:**
- `getSwapQuoteExactInput(fromToken, toToken, amount)` - Get quote for known spending
- `getSwapQuoteExactOutput(fromToken, toToken, amount)` - Get quote for known output
- `executeSwap(fromToken, toToken, inputAmount, estimatedOutput, feeTier, slippageTolerance)` -
Execute swaps with slippage protection
- `getSwapUserAssets(walletAddress)` - Query user token balances
- `getSwapPoolInfo(tokenA, tokenB)` - Get pool liquidity and fee information
**Architecture:**
- Three-layer design: LaunchpadSDK → GSwapService (wrapper) → @gala-chain/gswap-sdk (core)
- Automatic token format conversion (simple: "GALA" ↔ full: "GALA|Unit|none|none")
- Real-time WebSocket event monitoring for transaction confirmation
- Comprehensive slippage protection (configurable tolerance: 0.0001 to 1.0)
- Support for three fee tiers per pool: 500 (0.05%), 3000 (0.30%), 10000 (1.00%)
### 5 New MCP Tools
- `gala_launchpad_get_swap_quote_exact_input` - Get swap quote with known input
- `gala_launchpad_get_swap_quote_exact_output` - Get swap quote with known output
- `gala_launchpad_execute_swap` - Execute DEX swap with slippage protection
- `gala_launchpad_get_swap_user_assets` - Query wallet token balances
- `gala_launchpad_get_swap_pool_info` - Get DEX pool information
### 1 New MCP Slash Command
- `/galachain-launchpad:dex-swap tokenName=GALA toToken=GUSDC amount=100 slippage=1` - Guided DEX
swap workflow
### Comprehensive Test Coverage
- **gswap-service.test.ts** (45+ test cases) - Full GSwapService integration tests with mocked
GSwap SDK
- **token-format-converter.test.ts** (67+ test cases) - Bidirectional token format conversion
tests
- **dex-tools.test.ts** (40+ test cases per tool) - MCP tool configuration and schema validation
- **200+ total test cases** covering edge cases, error handling, and real-world scenarios
### Complete Documentation
**API.md (450+ lines):**
- Comprehensive API reference for all SDK methods
- DEX trading methods with examples
- Type definitions and error handling patterns
- Complete installation and usage guide
**CLAUDE.md Updates (250+ lines):**
- GalaSwap DEX Trading Methods section with architecture diagram
- Complete trading workflow examples
- Real-time monitoring via WebSocket
- Error handling patterns
- Performance characteristics
**gswap-integration.md (400+ lines):**
- Complete DEX integration guide
- Architecture overview with three-layer design
- 4 usage patterns: simple swap, pool info, portfolio tracking, real-time monitoring
- Token format handling and conversion
- Slippage protection strategies
- Fee tier analysis and optimization
- Troubleshooting and advanced topics
## Technical Improvements
### Token Format Converter Enhancement
Fixed edge cases revealed by comprehensive tests:
- Proper handling of already-formatted tokens (no double-processing)
- Object input support with TokenClassKey parsing
- Graceful null/undefined input handling
- Backward compatibility with old/new token formats
### Bundle Size Optimization
All formats remain well under 50 kB limit:
- ESM: 38.79 kB gzipped
- CommonJS: 38.89 kB gzipped
- UMD: 39.01 kB gzipped
GSwap SDK marked as external dependency (<1 KB bundle impact)
## Breaking Changes
None - fully backward compatible with v3.22.x
## Migration Guide
No migration needed. New methods are additive:
```typescript
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ privateKey: process.env.PRIVATE_KEY });
// New DEX trading methods available
const quote = await sdk.getSwapQuoteExactInput('GALA', 'GUSDC', '100');
const result = await sdk.executeSwap(...);
// All existing bonding curve methods still work
await sdk.buyTokens('anime', '100', ...);
```
## Dependencies
- Added: @gala-chain/gswap-sdk@0.0.7 (marked as external)
- No breaking dependency changes
## Next Steps
- Try the new `/galachain-launchpad:dex-swap` slash command in Claude Desktop
- Explore 5 new DEX trading tools in MCP server
- Reference API.md for complete method signatures
- See gswap-integration.md for integration patterns
### Patch Changes
- Updated dependencies [683396d]
- @gala-chain/launchpad-sdk@3.24.0
## 1.18.0
### Minor Changes
- **BREAKING CHANGE:** Default environment changed from `development` to `production`
All SDK and MCP initialization now defaults to production environment
(`lpad-backend-prod1.defi.gala.com`) instead of development. To use development environment,
explicitly set `env: 'DEVELOPMENT'` or `ENVIRONMENT=development`.
Changes include:
- SDK `AgentConfig.detectEnvironment()` defaults to 'production'
- MCP Server environment defaults to 'production'
- All examples and documentation updated to show production as default
- All installation instructions updated accordingly
Users relying on implicit development environment must now explicitly set the environment
variable.
### Patch Changes
- Updated dependencies
- @gala-chain/launchpad-sdk@3.23.0
## 1.17.7
### Patch Changes
- Bump SDK dependency to v3.22.7 which includes the new read-only operations example
## 1.18.0
### Minor Changes
- feat: Implement optional wallet support with 3 new wallet management tools (57 tools across
read-only and full-access modes)
## Overview
PRIVATE_KEY environment variable is now optional, enabling two distinct operational modes:
- **Read-Only Mode**: Query pools, prices, token details without wallet (40+ tools available)
- **Full-Access Mode**: Execute trades, create tokens, sign transactions with wallet (17+
additional tools)
## New Wallet Management Tools
- **`gala_launchpad_has_wallet`** - Check if MCP server wallet is currently configured
- **`gala_launchpad_get_wallet`** - Retrieve the configured wallet address (GalaChain and Ethereum
formats)
- **`gala_launchpad_set_wallet`** - Configure wallet for signing operations dynamically
## Installation
**Full-Access Mode (with wallet):**
```bash
claude mcp add "galachain-launchpad" -- \
env PRIVATE_KEY=<YOUR_KEY> ENVIRONMENT=production \
npx -y @gala-chain/launchpad-mcp-server@latest
```
**Read-Only Mode (no wallet):**
```bash
claude mcp add "galachain-launchpad" -- \
env ENVIRONMENT=production \
npx -y @gala-chain/launchpad-mcp-server@latest
```
## Key Features
- **Optional PRIVATE_KEY**: Omit `PRIVATE_KEY` environment variable for read-only mode
- **Progressive Enhancement**: Start with read-only queries, upgrade by setting wallet dynamically
- **Smart Tool Availability**: Tools requiring wallet automatically disabled in read-only mode
- **Seamless Claude Desktop Integration**: Full compatibility with Claude Desktop MCP server setup
- **Type Safety**: Wallet validation matches SDK implementation for consistency
- **Backward Compatible**: Existing installations with PRIVATE_KEY continue to work unchanged
## Tool Categories (57 Total)
- **Pool Management & Pricing** (17 tools) - Fetch pools, details, distributions, badges, prices
- **Price History & Analysis** (4 tools) - Historical price data and trends
- **Trading Operations** (13 tools) - Buy/sell calculations, token trades, graduation
- **Balance & Portfolio** (6 tools) - Token balances, holdings, profiles
- **Token Creation & Management** (4 tools) - Launch tokens, upload images, manage metadata
- **Wallet Management** (3 tools) - Check, get, set wallet configuration
- **Utility & Social** (10 tools) - Comments, transfers, configuration, URL generation
## SDK Dependency Update
- Updated @gala-chain/launchpad-sdk to 3.23.0
- Incorporates 4 new wallet management methods (hasWallet, getWallet, setWallet, validateWallet)
- All MCP tools leverage SDK's new optional wallet support
## Test Coverage
- Unit tests for optional wallet mode detection and tool filtering
- Integration tests for read-only mode MCP operations (pool queries, price fetches)
- Integration tests for full-access mode with wallet operations (trades, transfers, creation)
- Tool availability verification for both operational modes
## 1.17.5
### Patch Changes
- Fix: Remove 7 unnecessary escape characters (\$) in SDK usage examples - $ does not need escaping
in template literals when not part of ${} Fix: Remove 3 unused imports in SDK and diagnostic
scripts
- Updated dependencies
- @gala-chain/launchpad-sdk@3.22.5
## 1.17.4
### Patch Changes
- Add intelligent DEX fallback for ungraduated tokens in fetchTokenSpotPrice. When querying spot
prices with tokenId format for ungraduated tokens (which return 400/404 from DEX API), the SDK now
intelligently extracts the token name from GalaChain metadata and falls back to launchpad pricing.
This provides seamless support for both graduated (DEX) and ungraduated (launchpad) tokens via the
same tokenId parameter.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.22.4
## 1.17.3
### Patch Changes
- docs: update changelogs for v3.22.2 and v1.17.2 releases
- Updated dependencies
- @gala-chain/launchpad-sdk@3.22.3
## 1.17.2
### Patch Changes
- Dependency bump: @gala-chain/launchpad-sdk@3.22.2
Includes fix for GalaChain FetchTokenClasses endpoint authentication issue. The endpoint is public
but rejects authenticated requests. SDK now uses unauthenticated axios for public token metadata
queries.
**Result:**
- Token details now fetch correctly for all token types
- Launchpad token metadata queries no longer fail with 404 errors
- All 1131 SDK tests passing
## 1.17.1
### Patch Changes
- Dependency bump: @gala-chain/launchpad-sdk@3.22.1
Includes fix for GalaChainService response parsing. The FetchTokenClasses endpoint returns
`Data: TokenClass[]` directly, not `Data: { results: TokenClass[] }`.
**Result:**
- Token metadata queries return correct data instead of "Token not found" errors
- All 1131 SDK tests passing
## 1.17.0
### Minor Changes
- d5371ff: feat: Implement symbol caching in DexService and TokenMetadataCache for optimized spot
price queries
## Changes
- **TokenMetadataCache Extension**: Added tokenId-based caching methods (getByTokenId,
setByTokenId, hasByTokenId) to support caching immutable token symbols from DEX API metadata
- **DexService Symbol Caching**: Implemented cache-first pattern in \_fetchDexTokenSpotPrice() to
eliminate redundant `/v1/tokens` API calls on repeated spot price queries
- **LaunchpadSDK Integration**: Instantiated TokenMetadataCache and wired it through DexService
constructor for transparent symbol caching across all spot price operations
- **Performance**: First spot price query ~100-300ms (API call + cache), subsequent queries
~50-150ms (cache hit, ~50% faster)
- **Backward Compatibility**: Cache is optional (undefined cache parameter continues to work,
falling back to fallback symbol from tokenInstance.type)
## Implementation Details
### Cache Key Format
Token symbols cached using pipe-delimited format with `token:` prefix to distinguish from
tokenName entries:
- Example: `token:GUSDC|Unit|none|eth:0x...`
### Symbol Immutability
Symbols are guaranteed immutable based on DEX API contract - cached symbols never change, enabling
simple caching without TTL
### Error Handling
Symbol fetch failures gracefully fall back to tokenInstance.type.toUpperCase() without affecting
cache or price calculation
## Test Coverage
- 9 new unit tests for TokenMetadataCache tokenId methods
- 8 new integration tests for DexService symbol caching
- All 1133 tests passing
- Focus on: cache hits/misses, multiple token handling, metadata merging, backward compatibility
### Patch Changes
- Replace DEX API /v1/tokens with GalaChain native FetchTokenClasses API for authoritative token
metadata
**Summary:**
- Migrated token details fetching from DEX API to GalaChain native API
- Fixes bug where GALA spot price returned symbol "NONE" instead of "GALA"
- Removes obsolete dexApiHttp parameter from DexService
- Improves token metadata accuracy by using blockchain source of truth
**Changes:**
- Added `fetchTokenClassFromChain()` method to GalaChainService for native token metadata queries
- Updated DexService to use GalaChainService instead of DEX API for token details
- Wired GalaChainService through LaunchpadSDK to DexService
- Updated all tests to use GalaChainService mocks instead of DEX API mocks
- Removed unused HttpClient import and type definitions from DexService
- Removed unused dexApiHttp parameter from DexService constructor
**Technical Details:**
- GalaChain API endpoint: `/api/asset/token-contract/FetchTokenClasses`
- Source of truth: GalaChain native blockchain API (includes all tokens: native and wrapped)
- Backward compatibility: All existing APIs remain unchanged
- Test coverage: All 1131 tests passing
- Updated dependencies
- Updated dependencies [d5371ff]
- @gala-chain/launchpad-sdk@3.22.0
## 1.16.4
### Patch Changes
- Fetch token symbol metadata from DEX API instead of deriving from type field
Instead of trusting the type field for token symbols (which doesn't always align with actual token
symbols), now properly fetch token metadata from /v1/tokens endpoint to get the correct symbol.
Includes graceful fallback to type field if metadata fetch fails.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.21.4
## 1.16.3
### Patch Changes
- Fix GALA token symbol display in DEX pricing
When fetching GALA price from DEX Backend API, the symbol was showing as 'NONE' instead of 'GALA'
because the type field is 'none'. Added special handling to use the collection name as the symbol
for GALA tokens.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.21.3
## 1.16.2
### Patch Changes
- Fix GALA token ID format for DEX Backend API pricing
The GALA token ID was using incorrect format `GALA|Unit|Unit|none` when the DEX Backend API
expects `GALA|Unit|none|none`. This caused all GALA price queries to fail with 400 "Token Not
found" errors. Corrected the type field from 'Unit' to 'none' in both DexService and LaunchpadSDK.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.21.2
## 1.16.1
### Patch Changes
- Fix MCP tool registry validation to prevent server initialization failure
The tool registry was validating for 57 tools but only 54 exist, causing the MCP server to fail
during startup. Corrected the validation count to match actual tool count.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.21.1
## 1.16.0
### Minor Changes
- Implement unified smart router for token spot price queries
**Breaking Changes (v3.21.0 -> v4.0.0):**
- `fetchTokenSpotPrice()` signature changed: now accepts `FetchTokenSpotPriceParams` object with
`tokenName` or `tokenId` (mutually exclusive), not `string | string[]` for symbols
- `fetchLaunchpadTokenSpotPrice()` marked as deprecated - use `fetchTokenSpotPrice({ tokenName })`
instead
**Non-Breaking Changes (v3.21.0):**
- New smart router: `fetchTokenSpotPrice({ tokenName? | tokenId? })` automatically routes between
launchpad and DEX tokens
- New type: `FetchTokenSpotPriceParams` with flexible token identification
- Consolidated three separate endpoints into one intelligent router:
- `tokenName` → Launchpad tokens with graduation detection (bonding curve or DEX pricing)
- `tokenId` → DEX Backend API `/v1/trade/price` (direct pricing)
- DexService now validates parameters and routes tokenId to DEX Backend API
- LaunchpadSDK handles smart routing logic between tokenName and tokenId cases
- Deprecated `fetchTokenSpotPrice()` for symbol array queries
- Fixed GALA token ID format:
`collection: 'GALA', category: 'Unit', type: 'Unit', additionalKey: 'none'`
**Migration Guide:**
```typescript
// OLD (still works in v3.21.0, deprecated)
const prices = await sdk.fetchTokenSpotPrice(['GALA', 'SILK']);
const launchpadPrice = await sdk.fetchLaunchpadTokenSpotPrice('galadog');
// NEW (recommended)
const galaPrice = await sdk.fetchTokenSpotPrice({ tokenId: 'GALA|Unit|Unit|none' });
const launchpadPrice = await sdk.fetchTokenSpotPrice({ tokenName: 'galadog' });
const dexPrice = await sdk.fetchTokenSpotPrice({ tokenId: 'Token|Unit|GDOG|eth:...' });
```
**Testing:**
- Added 16 comprehensive tests for smart router pattern
- All 1118 SDK tests pass
- Backward compatibility verified for deprecated methods
### Patch Changes
- Updated dependencies
- @gala-chain/launchpad-sdk@3.21.0
## 1.15.1
### Patch Changes
- Fix isGraduated flag calculation to use correct saleStatus value
**Bug Fix:**
- Fixed `GalaChainService` calculation of `isGraduated` flag
- Was: `isGraduated = response.Data.saleStatus === 'Completed'` ❌
- Now: `isGraduated = response.Data.saleStatus === 'Finished'` ✅
- Backend actually returns `saleStatus: "Finished"` for graduated tokens, not `"Completed"`
- `DexService` now correctly uses reliable `isGraduated` flag for graduation detection
**Impact:**
- `fetchLaunchpadTokenSpotPrice()` now correctly identifies graduated tokens using `isGraduated`
- Tokens with `isGraduated: true` (saleStatus: "Finished") use `/v1/trade/price` DEX endpoint
- Ensures accurate spot pricing for graduated launchpad tokens like GALADOG
- No breaking changes - behavior corrected to match backend state progression
**Result:**
- GALADOG: `isGraduated: true` (saleStatus: "Finished") → Uses DEX endpoint ✅
- Other tokens: `isGraduated: false` (saleStatus: "Ongoing") → Uses bonding curve ✅
- Updated dependencies
- @gala-chain/launchpad-sdk@3.20.1
## 1.15.0
### Minor Changes
- Add tokenName parameter support to fetchPriceHistory and fetchAllPriceHistory (v3.20.0+)
**Features:**
- New optional `tokenName` parameter enables simple token names (e.g., "demonkpop") with automatic
resolution to full tokenId
- Mutual exclusivity validation: use exactly one of `tokenName` OR `tokenId` (not both, not
neither)
- Full backward compatibility with existing tokenId parameter usage (string and object formats)
- New helper method `fetchTokenClassKeyByTokenName()` for token name resolution
- Enhanced JSDoc with comprehensive examples for all three token identification methods
**SDK Changes:**
- `PriceHistoryService`: Added tokenName parameter support with auto-resolution via
TokenResolverService
- `LaunchpadSDK`: Wired TokenResolverService to PriceHistoryService for automatic name resolution
- Updated type definitions with optional `tokenName?: string` parameter
- Added comprehensive validation for mutual exclusivity
**MCP Server Changes:**
- `gala_launchpad_fetch_price_history`: Updated schema to support optional tokenName parameter
- `gala_launchpad_fetch_all_price_history`: Updated schema to support optional tokenName parameter
- Both tools now accept flexible token identification (tokenName or tokenId, choose one)
**Documentation:**
- Updated SDK README with new usage patterns and examples
- Updated CLAUDE.md Price History Patterns section
- Added complete section in complete-sdk-demo.ts demonstrating tokenName parameter
- Enhanced JSDoc comments for all methods with practical examples
**Testing:**
- Added 33 comprehensive unit tests covering:
- Token name to token class key resolution
- Mutual exclusivity validation
- Error handling for invalid inputs
- Integration with both fetchPriceHistory and fetchAllPriceHistory
- All test suites passing (1102 total tests)
**Breaking Changes:** None - fully backward compatible
**Migration Guide:** Instead of: `sdk.fetchPriceHistory({ tokenId: 'Token|Unit|DKP|eth:...' })`
You can now use: `sdk.fetchPriceHistory({ tokenName: 'demonkpop' })`
### Patch Changes
- Fix token format conversion and add DEX spot pricing for graduated launchpad tokens
**Bug Fixes:**
- **CRITICAL**: Fixed PriceHistoryService token format conversion that was losing Ethereum
addresses for launchpad tokens
- Was converting: `Token|Unit|GDOG|eth:902...` → `GDOG$Unit$none$none` ❌
- Now converts: `Token|Unit|GDOG|eth:902...` → `Token$Unit$GDOG$eth:902...` ✅
- Impact: All launchpad token price history queries now return data instead of empty results
- Affected methods: `fetchPriceHistory()`, `fetchAllPriceHistory()`
- Updated test expectations in `price-history-service.test.ts` to validate correct token format
- All 1,102 unit tests passing
**Features:**
- New method `DexService.fetchDexTokenSpotPrice(tokenId)` for real-time DEX market prices
- Uses `/v1/trade/price` endpoint for accurate graduated token pricing
- Supports both pipe-delimited and object token ID formats
- Perfect for tokens trading on the DEX post-graduation
- Enhanced `fetchLaunchpadTokenSpotPrice()` to intelligently select price source:
- Active pool tokens: Uses bonding curve calculation
- Graduated tokens: Uses `/v1/trade/price` endpoint for real DEX market prices
- Optional `fetchPoolDetails` parameter enables automatic graduation detection
- Gracefully falls back to bonding curve if graduation check unavailable
**SDK Changes:**
- `PriceHistoryService.ts`: Fixed token format converter to use `pipeFormatToDollarFormat()`
utility
- `DexService.ts`: Added `fetchDexTokenSpotPrice()` method with full documentation
- `DexService.ts`: Enhanced `fetchLaunchpadTokenSpotPrice()` with graduation detection
- Added import of `pipeFormatToDollarFormat` to DexService
**Test Results:**
- All price history service tests passing (33 tests)
- All SDK tests passing (1102 total tests)
- No regressions detected
**Breaking Changes:** None - both are enhancements/bug fixes
**Example Usage (Graduated Token):**
```typescript
// Graduated token now returns real DEX market price
const price = await sdk.fetchLaunchpadTokenSpotPrice(
'galadog',
calculateBuyAmount,
fetchPoolDetails // Optional - enables automatic DEX pricing
);
// Returns: { symbol: 'GALADOG', price: 0.019110 } (real market price)
```
**Example Usage (Direct DEX Pricing):**
```typescript
// Query DEX directly for any trading token
const price = await dexService.fetchDexTokenSpotPrice(
'Token|Unit|GDOG|eth:902Ef7566c8A8bEe5517FdEC0D7b5d1157942830'
);
// Returns: { symbol: 'GDOG', price: 0.019110 }
```
- Updated dependencies
- Updated dependencies
- @gala-chain/launchpad-sdk@3.20.0
## 1.14.3
### Patch Changes
- fix: correct fetchPools tool enum values to match SDK (recent/popular instead of
recent/trending/user)
## 1.14.2
### Patch Changes
- feat: enhance MCP SDK usage documentation with 200+ code examples
- Add price-history topic with fetchPriceHistory and fetchAllPriceHistory examples
- Add token-details topic with token metadata retrieval and validation
- Add profile-management topic with user profile workflows
- Enhance fetch-pools topic with 9 advanced examples and 11 tool equivalents
- Enhance balances topic with additional methods (fetchTokensCreated, fetchProfile)
- Expand mcp-to-sdk-mapping with 15+ missing tools across multiple sections
- Fix error-handling topic syntax error
- Updated dependencies
- @gala-chain/launchpad-sdk@3.19.2
## 1.14.0
### Breaking Changes
- **Remove MySQL-dependent MCP tools**
**BREAKING:** Removed MCP tools that relied on MySQL database. Tool count reduced from 56 to 54.
**Removed MCP Tools:**
- `gala_launchpad_fetch_prices` - Latest token prices (use DEX Backend API in future)
- `gala_launchpad_fetch_all_prices` - All latest token prices (use DEX Backend API in future)
**Environment Variables:**
- Removed: `MYSQL_CONNECTION_STRING` (no longer used)
**Migration Path:**
- For historical price data: Use `gala_launchpad_fetch_price_history` (DEX Backend API)
- For all historical data: Use `gala_launchpad_fetch_all_price_history` (with auto-pagination)
- Latest prices feature: Coming soon to DEX Backend API in future releases
**Added:**
- `gala_launchpad_fetch_all_price_history` - Auto-paginated historical price snapshots
- `gala_launchpad_fetch_token_details` - Comprehensive token metadata query
**Configuration Changes:**
- No MySQL configuration needed anymore
- DEX Backend API is automatically configured from environment
## 1.13.6
### Patch Changes
- Add fetchTokenDetails() method for comprehensive token metadata queries
**New Feature:** Implement fetchTokenDetails() method that queries the DEX API platform to
retrieve complete token metadata including images, decimals, descriptions, verification status,
network information, and trading capabilities.
**SDK Changes (v3.18.0):**
- Add TokenDetails DTO interface with 15+ metadata fields
- Implement DexService.fetchTokenDetails(tokenId) with flexible token ID support
- Add flat API method to LaunchpadSDK.fetchTokenDetails()
- Export TokenDetails type from SDK public API
- Comprehensive unit tests (14 tests covering success/error/edge cases)
**Features:**
- Flexible Token ID support: String format ('GUSDC|Unit|none|eth:0x...') or object format
- Comprehensive metadata: Returns symbol, name, decimals, image, verification status, network info
- DEX API Integration: Queries /v1/tokens endpoint with URL-encoded token class keys
- Proper error handling: Validates token existence and format
- Performance: Single API request, no pagination required
**MCP Server Changes (v1.13.6):**
- Create gala_launchpad_fetch_token_details MCP tool
- Register tool in poolTools with flexible tokenId input schema
- Add integration tests for tool handler
- Update tool count from 55 to 56 tools
- Update documentation in CLAUDE.md with usage examples
- Add tool reference to MCP server features list
**Documentation:**
- Add comprehensive pattern documentation to CLAUDE.md
- Include usage examples for string and object formats
- Document common use cases (token validation, pre-trading checks, network verification)
- Add error handling patterns and response structure reference
- Update SDK README.md with method signature and return type
- Update MCP server version and tool count references
- Updated dependencies
- @gala-chain/launchpad-sdk@3.18.0
## 1.13.5
### Patch Changes
- Simplify price history response structure with tokenId field
Replace individual token class fields (collection, category, type, additionalKey) with a single
pipe-delimited tokenId field in PriceSnapshot responses.
Changes:
- PriceSnapshot interface now has tokenId: string instead of separate fields
- Both fetchPriceHistory and fetchPrices return simplified snapshots
- Updated response transformation logic to construct tokenId from API data
- Made httpClient optional in PriceHistoryService constructor (only required when using
fetchPriceHistory, not for MySQL-only methods)
Example response change:
- Before: { price: '0.166', ..., collection: 'GALA', category: 'Unit', type: 'none',
additionalKey: 'none' }
- After: { price: '0.166', ..., tokenId: 'GALA|Unit|none|none' }
- Updated dependencies
- @gala-chain/launchpad-sdk@3.17.0
## 1.13.4
### Patch Changes
- ## Fix: Support Both GalaChain Token Format Variants (v3.16.4)
Enhanced token format handling to support both GalaChain token ID formats seamlessly.
GalaChain supports two token ID format variants:
**Format 1: Standard (collection="Token")**
```
Token|Unit|BENE|none → GALA$Unit$none$none
Token|Unit|SILK|none → SILK$Unit$none$none
```
**Format 2: Direct (collection=token name)**
```
GALA|Unit|none|none → GALA$Unit$none$none
SILK|Unit|none|none → SILK$Unit$none$none
```
Both are now handled correctly by detecting which field contains the token name and extracting it
appropriately for the DEX Backend API.
Changes:
- Detect token name location based on collection field
- Extract from `type` field if collection="Token", otherwise from `collection` field
- Build API format consistently: `{TOKEN_NAME}$Unit$none$none`
- Both token format variants now work identically
- Updated dependencies
- @gala-chain/launchpad-sdk@3.16.4
## 1.13.3
### Patch Changes
- ## Fix: Correct Token Format Conversion for Price History (v3.16.3)
Simplified token format conversion - removed overly strict validation and corrected the format
transformation logic.
The API expects simple pipe-to-dollar conversion:
- Input: `GALA|Unit|none|none`
- Output: `GALA$Unit$none$none`
Changed PriceHistoryService to:
- Use existing token normalization utilities
- Apply simple pipe-to-dollar format conversion
- Remove overly strict token format validation that was incorrectly rejecting valid formats
- Updated dependencies
- @gala-chain/launchpad-sdk@3.16.3
## 1.13.2
### Patch Changes
- ## Enhancement: Token Format Validation for Price History (v3.16.2)
**Added validation** to ensure correct token ID format for DEX Backend API compatibility.
The price history API requires tokens to follow GalaChain's standard format where the token name
is stored in the `type` field:
### Valid Formats
✅ String format: `Token|Unit|{TOKEN_NAME}|{additionalKey}`
```typescript
sdk.fetchPriceHistory({ tokenId: 'Token|Unit|BENE|none' });
sdk.fetchPriceHistory({ tokenId: 'Token|Unit|SILK|none' });
```
✅ Object format:
`{ collection: "Token", category: "Unit", type: "{TOKEN_NAME}", additionalKey: "{key}" }`
```typescript
sdk.fetchPriceHistory({
tokenId: { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' },
});
```
### Invalid Formats (Now Rejected)
❌ `GALA|Unit|none|none` - Token name in first field instead of third ❌ `Gala|Unit|none|none` -
Mixed case, ambiguous format ❌
`{ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }` - Wrong field
mapping
### Error Messages
When invalid format is provided, users now get clear guidance:
```
Invalid tokenId format for price history. Expected format: "Token|Unit|{TOKEN_NAME}|{additionalKey}"
(e.g., "Token|Unit|BENE|none"). Received: "GALA|Unit|none|none".
The token name must be in the third field (type), not the first field (collection).
```
### Changes
- Added comprehensive token format validation in `PriceHistoryService.validateOptions()`
- Validates both string and object token ID formats
- Provides clear error messages with examples
- Prevents silent failures from incorrect token format mapping
- Ensures DEX Backend API receives correctly formatted token identifiers
This prevents subtle bugs where tokens like `GALA|Unit|none|none` would be silently converted to
`none$Unit$none$none` (wrong).
- Updated dependencies
- @gala-chain/launchpad-sdk@3.16.2
## 1.13.1
### Patch Changes
- ## Fix: Price History Token Format Mapping (v3.16.1)
**Critical Fix:** Corrects token ID format conversion for DEX Backend API.
The DEX Backend API uses a different token format than GalaChain:
- API format: `tokenName$Unit$none$none` (e.g., `GALA$Unit$none$none`)
- SDK format: `collection|category|type|additionalKey` (e.g., `Token|Unit|BENE|none`)
### Changes
**PriceHistoryService.ts:**
- Fixed token format conversion when calling DEX Backend API
- Now correctly maps GalaChain TokenInstanceKey fields to API format
- Token name is extracted from the `type` field (where it's stored in GalaChain)
- API always receives properly formatted: `{tokenName}$Unit$none$none`
### Impact
- `fetchPriceHistory()` now returns historical price data correctly
- MCP tool `gala_launchpad_fetch_price_history` now works as expected
- All 30,000+ price snapshots now accessible for supported tokens
### Before
```typescript
// Input: Token|Unit|BENE|none
// Converted to: Token$Unit$GALA$none (WRONG - API expected GALA$Unit$none$none)
// Result: Empty response, no historical data
```
### After
```typescript
// Input: Token|Unit|BENE|none
// Converted to: GALA$Unit$none$none (CORRECT)
// Result: Returns all 30,862 GALA price snapshots
```
This is a critical fix for price history functionality.
- Updated dependencies
- @gala-chain/launchpad-sdk@3.16.1
## 1.13.0
### Minor Changes
- ## Price History API Migration (v3.16.0)
Migrate `fetchPriceHistory` and `fetchAllPriceHistory` methods from MySQL database backend to DEX
Backend API for improved performance and real-time data availability.
### SDK Changes (@gala-chain/launchpad-sdk)
- **New**: Added `tokenFormatConverter` utility (`src/utils/tokenFormatConverter.ts`)
- Convert between pipe-delimited (`GUSDC|Unit|none|eth:...`) and dollar-delimited token formats
- Convert sort order from SDK format (uppercase) to API format (lowercase)
- **Updated**: `environments.ts` - Added separate `dexBackendBaseUrl` config