SDK usage topics
Task-oriented examples for the Gala SDKs, one section per topic: the key concept, when to use it, the
SDK methods it covers, a complete example, the MCP tools that do the same job and the pitfalls. The
gala_launchpad_explain_sdk_usage tool returns one section of this page by topic key (the anchor of a
section is topic-<key>), read from the docs index, so a fix to a section reaches agents without an
npm release. Every example is compiled against the built SDK types by the docs build.
Buy Tokens
Key concept: Bonding-curve buys are flat LaunchpadSDK methods. Calculate the expected output before submitting so the transaction carries amount and fee protection.
When to use: Use for a token that has not graduated to the current-contract DEX.
Covers methods: calculateBuyAmount(), buy()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const quote = await sdk.calculateBuyAmount({ tokenName: 'anime', amount: '100', type: 'native' });
const result = await sdk.buy({ tokenName: 'anime', amount: '100', type: 'native', expectedAmount: quote.amount, maxAcceptableReverseBondingCurveFee: quote.reverseBondingCurveFee, slippageToleranceFactor: 0.01 });
console.log(result.transactionId, result.outputAmount);
MCP Tool Equivalents:
gala_launchpad_calculate_buy_amountgala_launchpad_buy
Pitfalls: Do not pass a pipe-delimited TokenClassKey to buy(); bonding-curve methods use the simple token name.
Related Topics: sell-tokens, pool-graduation, token-identification
Sell Tokens
Key concept: A bonding-curve sale uses calculateSellAmount() followed by sell() with the returned expected amount and reverse-fee bound.
When to use: Use before graduation when the token is still traded by the Launchpad bonding curve.
Covers methods: calculateSellAmount(), sell()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const quote = await sdk.calculateSellAmount({ tokenName: 'anime', amount: '100', type: 'exact' });
const result = await sdk.sell({ tokenName: 'anime', amount: '100', type: 'exact', expectedAmount: quote.amount, maxAcceptableReverseBondingCurveFee: quote.reverseBondingCurveFee, slippageToleranceFactor: 0.01 });
console.log(result.transactionId, result.outputAmount);
MCP Tool Equivalents:
gala_launchpad_calculate_sell_amountgala_launchpad_sell
Pitfalls: Use exact for the token quantity you are selling; use native only for a target GALA amount.
Related Topics: buy-tokens, pool-graduation
Pool Graduation
Key concept: Graduation is a flat Launchpad workflow: estimate the required buy amount, then call graduateToken() to move the pool to DEX trading.
When to use: Use when a token is near its graduation threshold and the wallet is ready to submit the migration trade.
Covers methods: calculateBuyAmountForGraduation(), graduateToken()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const quote = await sdk.calculateBuyAmountForGraduation('anime');
console.log('GALA required:', quote.amount);
const result = await sdk.graduateToken({ tokenName: 'anime', slippageToleranceFactor: 0.01 });
console.log(result.transactionId);
MCP Tool Equivalents:
gala_launchpad_calculate_buy_amount_for_graduationgala_launchpad_graduate_token
Pitfalls: After graduation, trade with a gswap-sdk GSwap client and the resulting TokenClassKey; do not continue bonding-curve trading blindly.
Related Topics: graduation-detection, dex-trading, token-identification
Fetch Pools
Key concept: fetchPools() and fetchAllPools() query bonding-curve pools; detail and calculation endpoints provide data for UI and quote workflows.
When to use: Use for listings, token lookup, chart preparation, and deciding which trading surface applies.
Covers methods: fetchPools(), fetchAllPools(), fetchPoolDetails(), fetchPoolDetailsForCalculation(), fetchVolumeData(), fetchTokenPrice(), fetchTokenDistribution(), resolveVaultAddress(), resolveTokenClassKey()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const page = await sdk.fetchPools({ type: 'recent', pageSize: 10 });
const all = await sdk.fetchAllPools({ type: 'recent' });
const details = await sdk.fetchPoolDetails('anime');
const calculationData = await sdk.fetchPoolDetailsForCalculation('anime');
console.log(page, all.items.length, details, calculationData);
MCP Tool Equivalents:
gala_launchpad_fetch_poolsgala_launchpad_fetch_all_poolsgala_launchpad_fetch_pool_detailsgala_launchpad_fetch_pool_details_for_calculationgala_launchpad_fetch_volume_datagala_launchpad_fetch_token_spot_pricegala_launchpad_fetch_token_distributiongala_launchpad_resolve_vault_addressgala_launchpad_resolve_token_class_key
Pitfalls: The old token-badges endpoint was removed; use current pool, distribution, and token-detail endpoints instead.
Related Topics: balances, token-details, graduation-detection
Balances
Key concept: Balance methods cover native GALA, token balances, available amounts, locked amounts, held tokens, and created tokens.
When to use: Use for portfolio screens and preflight checks before a write.
Covers methods: fetchGalaBalance(), fetchTokenBalance(), fetchAvailableBalance(), fetchLockedBalance(), fetchTokensHeld(), fetchTokensCreated()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const address = sdk.getAddress();
const gala = await sdk.fetchGalaBalance();
const token = await sdk.fetchTokenBalance({ tokenName: 'anime', address });
const available = await sdk.fetchAvailableBalance({ tokenName: 'anime', address });
const locked = await sdk.fetchLockedBalance({ tokenName: 'anime', address });
const held = await sdk.fetchTokensHeld({ address, pageSize: 20 });
console.log(gala, token, available, locked, held);
MCP Tool Equivalents:
gala_launchpad_fetch_gala_balancegala_launchpad_fetch_token_balancegala_launchpad_fetch_available_balancegala_launchpad_fetch_locked_tokensgala_launchpad_fetch_tokens_heldgala_launchpad_fetch_tokens_created
Pitfalls: Available balance excludes locked amounts; use the address format expected by each method.
Related Topics: transfers, locks, profile-management
Token Creation
Key concept: Token creation validates the name and symbol, reads the launch fee, optionally uploads an image, and calls launchToken().
When to use: Use when creating a new pre-graduation token from a Node.js or browser application.
Covers methods: isTokenNameAvailable(), isTokenSymbolAvailable(), fetchLaunchTokenFee(), uploadTokenImage(), launchToken()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
if (!(await sdk.isTokenNameAvailable('anime')) || !(await sdk.isTokenSymbolAvailable('ANIME'))) throw new Error('Name or symbol is unavailable');
console.log('Launch fee:', await sdk.fetchLaunchTokenFee());
const result = await sdk.launchToken({ tokenName: 'anime', tokenSymbol: 'ANIME', tokenDescription: 'Example token', tokenImage: 'https://example.test/anime.png' });
console.log(result.transactionId);
MCP Tool Equivalents:
gala_launchpad_check_token_namegala_launchpad_check_token_symbolgala_launchpad_fetch_launch_token_feegala_launchpad_upload_token_imagegala_launchpad_launch_token
Pitfalls: Availability checks are advisory; handle a rejected launch and never put a real private key in source control.
Related Topics: pool-graduation, token-details, wallet-connect
Token Details
Key concept: fetchTokenDetails() reads DEX-facing metadata by TokenClassKey, while fetchToken() is the Launchpad token-name lookup.
When to use: Use when the UI needs canonical collection, symbol, decimals, or contract metadata.
Covers methods: fetchTokenDetails(), fetchPoolDetails(), validateToken()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const details = await sdk.fetchTokenDetails('GALA|Unit|none|none');
const launchpadToken = await sdk.fetchToken('anime');
const stats = await sdk.fetchTokenStats('anime');
console.log(details, launchpadToken, stats);
MCP Tool Equivalents:
gala_launchpad_fetch_token_detailsgala_launchpad_fetch_pool_detailsgala_launchpad_validate_token
Pitfalls: Do not confuse a simple Launchpad token name with a pipe-delimited DEX TokenClassKey.
Related Topics: token-identification, fetch-pools, spot-prices-smart-routing
Token Distribution
Key concept: Distribution and holder-context methods expose supply ownership and a specific wallet’s position without requiring a write wallet.
When to use: Use for token pages, concentration warnings, and holder dashboards.
Covers methods: fetchTokenDistribution(), fetchUserHolderContext()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const distribution = await sdk.fetchTokenDistribution('anime');
const context = await sdk.fetchUserHolderContext('anime', 'eth|1234567890123456789012345678901234567890');
console.log(distribution, context);
MCP Tool Equivalents:
gala_launchpad_fetch_token_distributiongala_launchpad_fetch_user_holder_context
Pitfalls: Treat balances as decimal strings; do not use binary floating-point arithmetic for financial comparisons.
Related Topics: holders, balances, trading-analytics
Token Status
Key concept: Use isTokenGraduated() for an explicit check and the supported Launchpad creation watcher for realtime token events.
When to use: Use before choosing bonding-curve versus DEX code and when refreshing token listings.
Covers methods: isTokenGraduated(), onLaunchpadTokenCreation()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const graduated = await sdk.isTokenGraduated('anime');
console.log('Graduated:', graduated);
const unsubscribe = sdk.onLaunchpadTokenCreation((event) => console.log('Created:', event));
unsubscribe();
MCP Tool Equivalents:
gala_launchpad_is_token_graduatedgala_launchpad_on_launchpad_token_creation
Pitfalls: The legacy DEX pool-creation subscription is not the supported v7 path; use current DEX reads and Launchpad realtime APIs.
Related Topics: graduation-detection, fetch-pools, event-subscriptions
Wallet Connect
Key concept: LaunchpadSDK accepts a wallet or provider and exposes backend and Ethereum address formats through getAddress() and getEthereumAddress().
When to use: Use at application startup before signing operations.
Covers methods: getAddress(), getEthereumAddress(), hasWallet()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
if (!sdk.hasWallet()) throw new Error('Wallet is required');
console.log(sdk.getAddress());
console.log(sdk.getEthereumAddress());
MCP Tool Equivalents:
gala_launchpad_has_walletgala_launchpad_get_addressgala_launchpad_get_ethereum_address
Pitfalls: getAddress() returns eth| format; getEthereumAddress() returns 0x format.
Related Topics: multi-wallet, transfers, session-auth
Multi Wallet
Key concept: The SDK supports replacing its wallet at runtime; exported helpers provide key derivation utilities for controlled onboarding flows.
When to use: Use for account switching and key import flows.
Covers methods: setWallet(), getWallet(), getPublicKeyFromPrivateKey(), getEthereumAddressFromPrivateKey()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
import { getPublicKeyFromPrivateKey, getEthereumAddressFromPrivateKey } from '@gala-chain/gala-core-sdk';
import { Wallet } from 'ethers';
const sdk = createLaunchpadSDK({ env: 'stage' });
sdk.setWallet(new Wallet(process.env.WALLET_PRIVATE_KEY!));
console.log(sdk.getAddress(), sdk.getWallet());
const publicKey = getPublicKeyFromPrivateKey(process.env.WALLET_PRIVATE_KEY!);
const ethereumAddress = getEthereumAddressFromPrivateKey(process.env.WALLET_PRIVATE_KEY!);
console.log(publicKey, ethereumAddress);
MCP Tool Equivalents:
gala_launchpad_set_walletgala_launchpad_get_walletgala_launchpad_get_public_key_from_private_keygala_launchpad_get_ethereum_address_from_private_key
Pitfalls: The helper functions are package exports, not LaunchpadSDK instance methods; never log private keys.
Related Topics: wallet-connect, utilities-system, session-auth
Transfers
Key concept: GALA has a dedicated transfer method; other assets use transferToken() with a token name or full token identifier.
When to use: Use after validating the recipient and amount, with a signing wallet configured.
Covers methods: transferGala(), transferToken()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const gala = await sdk.transferGala({ recipientAddress: 'eth|1234567890123456789012345678901234567890', amount: '1' });
const token = await sdk.transferToken({ to: 'eth|1234567890123456789012345678901234567890', tokenId: 'GALA|Unit|none|none', amount: '1' });
console.log(gala.transactionId, token.transactionId);
MCP Tool Equivalents:
gala_launchpad_transfer_galagala_launchpad_transfer_token
Pitfalls: v7 token writes return direct chain results; confirm with a balance read when business logic needs verification.
Related Topics: balances, locks, wallet-connect
Locks
Key concept: Lock, unlock, and burn are native token writes in v7. Burn is irreversible and all three require a signer.
When to use: Use for vesting/escrow workflows or an intentional supply reduction.
Covers methods: lockTokens(), unlockTokens(), burnTokens(), fetchLockedBalance()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const locked = await sdk.lockTokens({ tokens: [{ tokenName: 'anime', amount: '100' }] });
await sdk.unlockTokens({ tokens: [{ tokenName: 'anime', amount: '25' }] });
const balance = await sdk.fetchLockedBalance({ tokenName: 'anime', address: sdk.getAddress() });
console.log(locked, balance);
// Only call after explicit confirmation: await sdk.burnTokens({ tokens: [{ tokenName: 'anime', amount: '1' }] });
MCP Tool Equivalents:
gala_launchpad_lock_tokensgala_launchpad_unlock_tokensgala_launchpad_burn_tokensgala_launchpad_fetch_locked_tokens
Pitfalls: Burn cannot be undone; v7 does not use the old DEX service or EIP-712 DEX write path here.
Related Topics: balances, transfers, error-handling
Dex Trading
Key concept: The DEX is gswap-sdk: build a GSwap client with the same key (launchpad-sdk has none). Quote with gSwap.quoting, submit with gSwap.swaps, and wait for queued confirmation.
When to use: Use for graduated tokens and standard GalaChain assets.
Covers methods: gSwap.quoting.quoteExactInput(), gSwap.quoting.quoteExactOutput(), gSwap.swaps.swap()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
import { PrivateKeySigner } from '@gala-chain/gala-core-sdk';
import { GSwap } from '@gala-chain/gswap-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const gSwap = new GSwap({ env: 'stage', signer: new PrivateKeySigner(process.env.WALLET_PRIVATE_KEY!), walletAddress: sdk.getAddress() });
const quote = await gSwap.quoting.quoteExactInput('GALA|Unit|none|none', 'GUSDC|Unit|none|none', '100');
const submission = await gSwap.swaps.swap('GALA|Unit|none|none', 'GUSDC|Unit|none|none', quote.fee, { exactIn: '100', amountOutMinimum: quote.amountOut });
const trade = await submission.confirm();
console.log(trade);
MCP Tool Equivalents:
gala_launchpad_get_swap_quote_exact_inputgala_launchpad_get_swap_quote_exact_outputgala_launchpad_execute_swapgala_launchpad_get_swap_result
Pitfalls: A returned submission is not proof of execution until confirm() resolves.
Related Topics: queued-swap-recovery, dex-pools, liquidity-positions
Error Handling
Key concept: Read typed errors and transaction state, and use getBundlerTransactionResult() when a Launchpad submission needs a result lookup.
When to use: Use around every write boundary and in retry/recovery code.
Covers methods: getBundlerTransactionResult(), getConfig()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
try {
console.log(await sdk.getBundlerTransactionResult('bundle-id'));
} catch (error) {
console.error('SDK operation failed:', error);
}
MCP Tool Equivalents:
gala_launchpad_get_bundler_transaction_resultgala_launchpad_get_config
Pitfalls: Do not retry an unknown queued DEX write by submitting a second swap; use unique-key recovery.
Related Topics: queued-swap-recovery, buy-tokens, dex-trading
Installation
Key concept: createLaunchpadSDK() is the supported entry point; environment selection is explicit and defaults can be inspected with getConfig().
When to use: Use as the first setup step in Node.js, browser, or MCP integrations.
Covers methods: getVersion(), getConfig()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log('SDK version:', sdk.getVersion());
console.log('Environment:', sdk.getConfig().environment);
MCP Tool Equivalents:
gala_launchpad_get_versiongala_launchpad_get_config
Pitfalls: Use env: 'prod' or env: 'stage'; old uppercase and QA1 environment names are not v7 values.
Related Topics: configuration, wallet-connect
Local Calculations
Key concept: Bonding-curve amount calculations have local and external variants; local is fast while external reads backend state.
When to use: Use local calculations for responsive UI and external calculations when fresh state matters.
Covers methods: calculateBuyAmountLocal(), calculateSellAmountLocal(), calculateBuyAmountExternal(), calculateSellAmountExternal(), calculateInitialBuyAmount()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const localBuy = await sdk.calculateBuyAmountLocal({ tokenName: 'anime', amount: '10', type: 'native' });
const externalSell = await sdk.calculateSellAmountExternal({ tokenName: 'anime', amount: '10', type: 'exact' });
const initial = await sdk.calculateInitialBuyAmount('10');
console.log(localBuy, externalSell, initial);
MCP Tool Equivalents:
gala_launchpad_calculate_buy_amount_localgala_launchpad_calculate_sell_amount_externalgala_launchpad_calculate_initial_buy
Pitfalls: Local results depend on cached pool metadata and are not transaction confirmation.
Related Topics: buy-tokens, sell-tokens, fetch-pools
Price History
Key concept: Price series are gswap-sdk's market reads (launchpad-sdk resolves a launchpad token name to its class key); the MCP tools page them.
When to use: Use for charts, return calculations, and historical market analysis.
Covers methods: resolveTokenClassKey(), gSwap.market.getPriceSeries()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
import { GSwap } from '@gala-chain/gswap-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk: price series are the swap backend's
const key = await sdk.resolveTokenClassKey('anime');
const series = await gSwap.market.getPriceSeries(key, '1W');
console.log(series.currentPrice, series.prices.length);
MCP Tool Equivalents:
gala_launchpad_fetch_price_historygala_launchpad_fetch_all_price_history
Pitfalls: Use the current market price-series API; removed legacy graph and badge routes are not substitutes.
Related Topics: spot-prices-smart-routing, trading-analytics, fetch-pools
Spot Prices Smart Routing
Key concept: fetchTokenPrice() prices a launchpad token by name (bonding curve, or the swap backend once graduated); any token by class key, GALA included, is gswap-sdk's gSwap.market.getPrice().
When to use: Use when a price display may receive either a Launchpad name or DEX identifier.
Covers methods: fetchTokenPrice(), gSwap.market.getPrice()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
import { GSwap } from '@gala-chain/gswap-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk: the DEX price of a token by class key, GALA included
const launchpadPrice = await sdk.fetchTokenPrice({ tokenName: 'anime' });
const galaPrice = await gSwap.market.getPrice('GALA|Unit|none|none');
console.log(launchpadPrice, galaPrice?.price);
MCP Tool Equivalents:
gala_launchpad_fetch_token_spot_pricegala_launchpad_fetch_gala_spot_price
Pitfalls: Do not construct a DEX token key from a token name; resolve the canonical key first.
Related Topics: token-identification, price-history, dex-token-discovery
Profile Management
Key concept: Profile reads and writes are flat SDK methods; managed-token lookup is a separate creator-dashboard read.
When to use: Use for account pages and token-owner management views.
Covers methods: fetchProfile(), updateProfile(), uploadProfileImage(), getManagedTokens()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const profile = await sdk.fetchProfile();
await sdk.updateProfile({ fullName: 'Example creator' });
const managed = await sdk.getManagedTokens();
console.log(profile, managed);
MCP Tool Equivalents:
gala_launchpad_fetch_profilegala_launchpad_update_profilegala_launchpad_upload_profile_imagegala_launchpad_get_managed_tokens
Pitfalls: Profile image upload accepts its own DTO; do not confuse it with token image upload.
Related Topics: balances, token-creation, multi-wallet
Liquidity Positions
Key concept: GSwap positions are gswap-sdk's gSwap.positions. Reads are signer-free; writes return queued submissions.
When to use: Use for concentrated-liquidity portfolio screens and LP maintenance.
Covers methods: gSwap.positions.getUserPositions(), gSwap.positions.addLiquidityByTicks(), gSwap.positions.removeLiquidity(), gSwap.positions.collectPositionFees()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
import { PrivateKeySigner } from '@gala-chain/gala-core-sdk';
import { GSwap } from '@gala-chain/gswap-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const gSwap = new GSwap({ env: 'stage', signer: new PrivateKeySigner(process.env.WALLET_PRIVATE_KEY!), walletAddress: sdk.getAddress() });
const positions = await gSwap.positions.getUserPositions(sdk.getAddress());
console.log(positions);
// Writes use the position DTO and return a queued SubmittedTransaction.
// const added = await gSwap.positions.addLiquidityByTicks({ token0: 'GALA|Unit|none|none', token1: 'GUSDC|Unit|none|none', fee: 3000, tickLower: -60, tickUpper: 60, amount0Desired: '10', amount1Desired: '1' });
// await added.confirm();
MCP Tool Equivalents:
gala_launchpad_get_user_liquidity_positionsgala_launchpad_add_liquidity_by_ticksgala_launchpad_remove_liquiditygala_launchpad_collect_position_fees
Pitfalls: LP operations require full DEX token identifiers; old flat DEX methods are gone.
Related Topics: dex-trading, dex-pools, queued-swap-recovery
Advanced Dex Analysis
Key concept: GSwap quoting replaces legacy composite-pool and exact-amount helpers while preserving exact-input and exact-output workflows.
When to use: Use for route analysis, price impact, and trade previews.
Covers methods: gSwap.quoting.quoteExactInput(), gSwap.quoting.quoteExactOutput()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk; quotes need no signer
const exactIn = await gSwap.quoting.quoteExactInput('GALA|Unit|none|none', 'GUSDC|Unit|none|none', '100');
const exactOut = await gSwap.quoting.quoteExactOutput('GALA|Unit|none|none', 'GUSDC|Unit|none|none', '10');
console.log(exactIn, exactOut);
MCP Tool Equivalents:
gala_launchpad_get_swap_quote_exact_inputgala_launchpad_get_swap_quote_exact_outputgala_launchpad_calculate_dex_pool_quote_localgala_launchpad_calculate_dex_pool_quote_external
Pitfalls: A quote can become stale; apply minimum output or maximum input on the subsequent swap.
Related Topics: dex-trading, dex-pools, spot-prices-smart-routing
Trading Analytics
Key concept: Trade queries and OHLCV volume data provide historical activity without requiring a signer.
When to use: Use for market dashboards, rankings, and post-trade analysis.
Covers methods: fetchTrades(), fetchVolumeData()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const trades = await sdk.fetchTrades({ tokenName: 'anime', pageSize: 20 });
const volume = await sdk.fetchVolumeData({ tokenName: 'anime', resolution: 3600 });
console.log(trades, volume);
MCP Tool Equivalents:
gala_launchpad_fetch_tradesgala_launchpad_fetch_volume_data
Pitfalls: Keep amount fields as strings and use API pagination instead of assuming one page is complete.
Related Topics: trade-history, recent-trades, price-history
Utilities And Helpers
Key concept: Utility methods cover supply reads, cache inspection, cleanup, and transaction lookup.
When to use: Use to build diagnostics, warm data, and controlled shutdown paths.
Covers methods: fetchTokenClassesWithSupply(), getBundlerTransactionResult(), getCacheInfo(), clearCache(), cleanup()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const supply = await sdk.fetchTokenClassesWithSupply([{ collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }]);
console.log(supply, sdk.getCacheInfo());
sdk.clearCache();
await sdk.cleanup();
MCP Tool Equivalents:
gala_launchpad_fetch_token_classes_with_supplygala_launchpad_get_cache_infogala_launchpad_clear_cachegala_launchpad_cleanup
Pitfalls: clearCache() is local maintenance; it does not invalidate chain state or cancel a transaction.
Related Topics: utilities-system, error-handling, balances
Utilities System
Key concept: Configuration, version, URL, wallet state, and websocket lifecycle are available as flat SDK utilities.
When to use: Use for diagnostics, health panels, and graceful shutdown.
Covers methods: getConfig(), getVersion(), getUrlByTokenName(), hasWallet()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(sdk.getConfig(), sdk.getVersion());
console.log(sdk.getUrlByTokenName('anime'), sdk.hasWallet());
console.log('WebSocket connected:', sdk.isWebSocketConnected());
MCP Tool Equivalents:
gala_launchpad_get_configgala_launchpad_get_versiongala_launchpad_get_url_by_token_namegala_launchpad_has_wallet
Pitfalls: The SDK config environment is not inferred from arbitrary URLs; choose a supported env explicitly.
Related Topics: installation, wallet-connect, error-handling
Fetch All Dex Seasons
Key concept: gSwap.leaderboard.getSeasons() returns the competition seasons (newest first), with Date bounds.
When to use: Use to populate a season selector or historical rankings.
Covers methods: gSwap.leaderboard.getSeasons()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk
console.log(await gSwap.leaderboard.getSeasons());
MCP Tool Equivalents:
gala_launchpad_fetch_all_dex_seasons
Pitfalls: Do not assume the first season is current.
Related Topics: fetch-current-dex-season, fetch-dex-leaderboard-by-season-id
Fetch Current Dex Season
Key concept: gSwap.leaderboard.getCurrentSeason() returns the running season (start and end inclusive) or null.
When to use: Use before requesting current-season rankings.
Covers methods: gSwap.leaderboard.getCurrentSeason()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk
const season = await gSwap.leaderboard.getCurrentSeason();
if (season) console.log(season.id);
MCP Tool Equivalents:
gala_launchpad_fetch_current_dex_season
Pitfalls: Handle null explicitly when no season is active.
Related Topics: fetch-all-dex-seasons, fetch-current-dex-leaderboard
Fetch Dex Leaderboard By Season Id
Key concept: gSwap.leaderboard.getLeaderboard(seasonId) retrieves the rankings of a known season (the top 100 wallets).
When to use: Use for historical season pages and audits.
Covers methods: gSwap.leaderboard.getLeaderboard()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk
console.log(await gSwap.leaderboard.getLeaderboard(1));
MCP Tool Equivalents:
gala_launchpad_fetch_dex_leaderboard_by_season_id
Pitfalls: Use an ID returned by gSwap.leaderboard.getSeasons().
Related Topics: fetch-all-dex-seasons, fetch-current-dex-season
Fetch Current Dex Leaderboard
Key concept: gSwap.leaderboard.getCurrentLeaderboard() is the convenience query for active rankings.
When to use: Use for a current leaderboard widget.
Covers methods: gSwap.leaderboard.getCurrentLeaderboard()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk
console.log(await gSwap.leaderboard.getCurrentLeaderboard());
MCP Tool Equivalents:
gala_launchpad_fetch_current_dex_leaderboard
Pitfalls: Render null as an empty state.
Related Topics: fetch-current-dex-season, fetch-dex-leaderboard-by-season-id
Fetch Dex Aggregated Volume Summary
Key concept: gSwap.market.getVolumeSummary() returns platform-level DEX metrics (TVL, 1d/7d/30d volume, trades; deltas as fractions).
When to use: Use for overview dashboards and season reporting.
Covers methods: gSwap.market.getVolumeSummary()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk
console.log(await gSwap.market.getVolumeSummary());
MCP Tool Equivalents:
gala_launchpad_fetch_dex_aggregated_volume_summary
Pitfalls: Aggregate volume is not wallet- or token-filtered trade history.
Related Topics: trading-analytics, platform-stats
Fetch Dex Pools
Key concept: GSwap pool discovery is gswap-sdk's gSwap.pools and replaces removed flat fetchDexPools methods.
When to use: Use for DEX pool lists, pool metadata, and slot-0 price state.
Covers methods: gSwap.pools.getPools(), gSwap.pools.getPool(), gSwap.pools.getSlot0()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk; pool reads need no signer
const pools = await gSwap.pools.getPools();
const pool = await gSwap.pools.getPool('GALA|Unit|none|none', 'GUSDC|Unit|none|none', 3000);
const slot0 = await gSwap.pools.getSlot0('GALA|Unit|none|none', 'GUSDC|Unit|none|none', 3000);
console.log(pools, pool, slot0);
MCP Tool Equivalents:
gala_launchpad_fetch_dex_poolsgala_launchpad_fetch_all_dex_poolsgala_launchpad_get_swap_pool_infogala_launchpad_get_swap_pool_price
Pitfalls: Use full token identifiers and a valid fee tier; DEX reads do not require a signer.
Related Topics: dex-token-discovery, dex-trading, advanced-dex-analysis
Event Subscriptions
Key concept: Launchpad stream subscriptions and typed callbacks provide supported realtime updates; DEX state is read through GSwap.
When to use: Use for live token pages, stream status, and event-driven UI.
Covers methods: subscribeToStream(), onLaunchpadTokenCreation()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
await sdk.connectStreamWebSocket();
const subscription = await sdk.subscribeToStream('anime', { onStreamStatus: (status) => console.log(status), onChatMessage: (message) => console.log(message) });
console.log(subscription);
MCP Tool Equivalents:
gala_launchpad_connect_stream_websocketgala_launchpad_subscribe_to_streamgala_launchpad_on_launchpad_token_creation
Pitfalls: Always retain and invoke the cleanup function supplied by the subscription workflow.
Related Topics: streaming, stream-chat, token-status
Mcp To Sdk Mapping
Key concept: MCP names are snake_case transport names; direct SDK calls use flat LaunchpadSDK methods, and the DEX tools use a gswap-sdk GSwap client (gSwap.quoting, gSwap.swaps, ...).
When to use: Use when migrating an MCP workflow into application code.
Covers methods: buy(), calculateBuyAmount(), fetchPools(), gSwap.swaps.swap()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
// gala_launchpad_calculate_buy_amount -> sdk.calculateBuyAmount()
// gala_launchpad_buy -> sdk.buy()
// gala_launchpad_fetch_pools -> sdk.fetchPools()
console.log(await sdk.calculateBuyAmount({ tokenName: 'anime', amount: '10', type: 'native' }));
MCP Tool Equivalents:
gala_launchpad_explain_sdk_usagegala_launchpad_calculate_buy_amountgala_launchpad_buygala_launchpad_fetch_pools
Pitfalls: Do not copy an MCP tool name into JavaScript; remove the gala_launchpad_ prefix and convert snake_case.
Related Topics: installation, dex-trading, buy-tokens
Bridge Operations
Key concept: Bridge fee, transfer, status, external balance, and bridgeability methods cover GalaChain, Ethereum, and Solana.
When to use: Use when moving a supported asset between GalaChain and an external network.
Covers methods: estimateBridgeFee(), bridgeOut(), bridgeIn(), getBridgeStatus(), fetchEthereumWalletAllBalances(), fetchSolanaWalletAllBalances()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const fee = await sdk.estimateBridgeFee({ tokenId: 'GALA|Unit|none|none', destinationChain: 'Ethereum' });
const balances = await sdk.fetchEthereumWalletAllBalances('0x1234567890123456789012345678901234567890');
console.log(fee, balances);
MCP Tool Equivalents:
gala_launchpad_estimate_bridge_feegala_launchpad_bridge_outgala_launchpad_bridge_ingala_launchpad_get_bridge_statusgala_launchpad_fetch_ethereum_wallet_all_balancesgala_launchpad_fetch_solana_wallet_all_balances
Pitfalls: Bridge DTOs and destination networks are chain-specific; do not reuse a Solana address as an Ethereum recipient.
Related Topics: wrap-unwrap-operations, dex-token-discovery, error-handling
Dex Token Discovery
Key concept: The GSwap symbol registry is gswap-sdk's gSwap.symbols.list(), replacing removed flat available-token methods.
When to use: Use before constructing a quote, swap, or position request.
Covers methods: gSwap.symbols.list()
import { GSwap } from '@gala-chain/gswap-sdk';
const gSwap = new GSwap({ env: 'stage' }); // gswap-sdk
const symbols = await gSwap.symbols.list();
console.log(symbols.find((entry) => entry.symbol === 'GALA'));
MCP Tool Equivalents:
gala_launchpad_fetch_available_dex_tokensgala_launchpad_fetch_all_available_dex_tokens
Pitfalls: Use canonical registry metadata; do not invent a TokenClassKey from a display symbol.
Related Topics: token-identification, dex-pools, dex-trading
Wrap Unwrap Operations
Key concept: Cross-channel wrap and unwrap remain flat LaunchpadSDK methods backed by GalaConnect.
When to use: Use when an asset has a supported wrapped counterpart and a signer is configured.
Covers methods: fetchWrappableTokens(), getWrapCounterpart(), estimateWrapFee(), wrapToken(), unwrapToken()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const tokens = await sdk.fetchWrappableTokens({ limit: 50 });
const MUSIC = '$MUSIC|Unit|none|none'; // token ids are class keys: a bare symbol is refused
const counterpart = await sdk.getWrapCounterpart(MUSIC);
const fee = await sdk.estimateWrapFee(MUSIC, '1');
const wrapped = await sdk.wrapToken({ tokenId: MUSIC, amount: '1' }); // throws a GalaSDKError unless completed
console.log(tokens, counterpart, fee, wrapped.transactionId);
MCP Tool Equivalents:
gala_launchpad_fetch_wrappable_tokensgala_launchpad_get_wrap_counterpartgala_launchpad_estimate_wrap_feegala_launchpad_wrap_tokengala_launchpad_unwrap_token
Pitfalls: Check isTokenWrappable() and the current counterpart before writing.
Related Topics: bridge-operations, dex-token-discovery
Referral System
Key concept: Referral URL, paginated referrals, complete lists, and summaries expose the creator referral program.
When to use: Use for referral links, attribution dashboards, and reward summaries.
Covers methods: fetchReferralUrl(), fetchReferrals(), fetchAllReferrals(), fetchReferralsSummary()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const url = await sdk.fetchReferralUrl();
const page = await sdk.fetchReferrals({ page: 1, limit: 20 });
console.log(url, page, await sdk.fetchReferralsSummary());
MCP Tool Equivalents:
gala_launchpad_fetch_referral_urlgala_launchpad_fetch_referralsgala_launchpad_fetch_all_referralsgala_launchpad_fetch_referrals_summary
Pitfalls: Use the returned referral URL rather than manually concatenating addresses.
Related Topics: profile-management, wallet-connect
Session Auth
Key concept: JWT session methods support login, refresh, logout, inspection, and access-token retrieval.
When to use: Use for authenticated API sessions independent of wallet-signature operations.
Covers methods: login(), getSession(), ensureValidToken(), refreshToken(), logout()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
await sdk.login();
console.log(await sdk.getSession(), await sdk.ensureValidToken());
await sdk.logout({ allDevices: false });
MCP Tool Equivalents:
gala_launchpad_logingala_launchpad_get_sessiongala_launchpad_ensure_valid_tokengala_launchpad_refresh_tokengala_launchpad_logout
Pitfalls: Keep access tokens out of logs and refresh before expiry.
Related Topics: wallet-connect, profile-management, api-key-management
Streaming
Key concept: Streaming methods cover lifecycle, credentials, recordings, simulcasts, global status, roles, and access checks.
When to use: Use for creator Studio and platform moderation workflows.
Covers methods: startStream(), stopStream(), getStreamRecordings(), getSimulcastTargets(), getGlobalStreamingStatus(), getStreamRole(), getTokenAccess()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const access = await sdk.getTokenAccess({ tokenName: 'anime' });
if (access.permissions.length > 0) console.log(await sdk.getStreamCredentials('anime'), await sdk.getSimulcastTargets('anime'));
console.log(await sdk.getGlobalStreamingStatus());
MCP Tool Equivalents:
gala_launchpad_get_token_accessgala_launchpad_get_global_streaming_statusgala_launchpad_get_stream_recordingsgala_launchpad_get_simulcast_targets
Pitfalls: Check role and token access before owner/admin operations.
Related Topics: stream-chat, event-subscriptions, moderator-invites
Stream Chat
Key concept: Stream chat uses websocket lifecycle plus send, reaction, typing, per-token controls, and slow-mode methods.
When to use: Use for live chat clients and creator moderation controls.
Covers methods: connectStreamWebSocket(), subscribeToStream(), sendStreamChatViaWebSocket(), sendStreamReaction(), disableChat(), enableChat(), setSlowMode()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
await sdk.connectStreamWebSocket();
await sdk.subscribeToStream('anime');
await sdk.sendStreamChatViaWebSocket('anime', 'Hello from the SDK');
await sdk.sendStreamReaction('anime', '🔥');
await sdk.setSlowMode('anime', 30);
sdk.disconnectStreamWebSocket();
MCP Tool Equivalents:
gala_launchpad_connect_stream_websocketgala_launchpad_subscribe_to_streamgala_launchpad_send_stream_chat_via_web_socketgala_launchpad_send_stream_reactiongala_launchpad_set_chat_enabledgala_launchpad_set_slow_mode
Pitfalls: Global chat enable/disable was removed; use per-token controls and current websocket APIs.
Related Topics: streaming, chat-messages, content-reactions
Ban Management
Key concept: Ban methods create, remove, list, inspect, and enumerate active users for a token.
When to use: Use for owner or moderator chat and content moderation.
Covers methods: createBan(), removeBan(), listBans(), getBanStatus(), getActiveUsers()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const result = await sdk.createBan({ tokenName: 'anime', userAddress: 'eth|1234567890123456789012345678901234567890', reason: 'Spam', durationSeconds: 3600 });
console.log(await sdk.getBanStatus({ tokenName: 'anime', userAddress: result.ban.userAddress }));
MCP Tool Equivalents:
gala_launchpad_create_bangala_launchpad_remove_bangala_launchpad_list_bansgala_launchpad_get_ban_statusgala_launchpad_get_active_users
Pitfalls: Ban permissions depend on owner, JWT, or API-key role.
Related Topics: content-flag-management, content-reactions, api-key-management
Api Key Management
Key concept: API-key methods provide role-scoped machine access.
When to use: Use for backend moderation or automation, never directly in a browser.
Covers methods: createApiKey(), listApiKeys(), getApiKey(), updateApiKey(), revokeApiKey(), getApiKeyRoles()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const created = await sdk.createApiKey({ role: 'MODERATOR', description: 'Chat moderation bot' });
console.log(created, await sdk.listApiKeys());
// Revoke when decommissioned: await sdk.revokeApiKey(created.id);
MCP Tool Equivalents:
gala_launchpad_create_api_keygala_launchpad_list_api_keysgala_launchpad_get_api_keygala_launchpad_update_api_keygala_launchpad_revoke_api_keygala_launchpad_get_api_key_roles
Pitfalls: Store a returned secret once in a secret manager.
Related Topics: session-auth, ban-management, moderator-invites
Moderator Invites
Key concept: Moderator methods create, claim, list, inspect, update, and revoke token-scoped delegation.
When to use: Use when a token owner grants limited Studio or moderation access.
Covers methods: createModeratorInvite(), claimModeratorInvite(), getModeratedTokens(), listModeratorInvites(), revokeModeratorInvite(), getModeratorInviteByCode(), updateModeratorInviteRole()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const invite = await sdk.createModeratorInvite({ tokenName: 'anime', role: 'MODERATOR', description: 'Community helper' });
console.log(invite, await sdk.listModeratorInvites({ tokenName: 'anime' }));
MCP Tool Equivalents:
gala_launchpad_create_moderator_invitegala_launchpad_claim_moderator_invitegala_launchpad_list_moderator_invitesgala_launchpad_update_moderator_invite_rolegala_launchpad_revoke_moderator_invitegala_launchpad_get_moderator_invite
Pitfalls: Invite codes are bearer credentials; send them only through a trusted channel.
Related Topics: api-key-management, overseer-invites, streaming
Overseer Invites
Key concept: Overseer workflows provide platform-wide invites, claims, status, summaries, and statistics.
When to use: Use only in a protected platform administration service.
Covers methods: createOverseerInvite(), listOverseerInvites(), claimOverseerInvite(), listOverseers(), getOverseerSummary(), getUserStats()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const invite = await sdk.createOverseerInvite({ description: 'Platform support', expiresAt: '2027-01-01T00:00:00Z' });
console.log(invite, await sdk.getOverseerSummary(), await sdk.getUserStats());
MCP Tool Equivalents:
gala_launchpad_create_overseer_invitegala_launchpad_list_overseer_invitesgala_launchpad_claim_overseer_invitegala_launchpad_list_overseersgala_launchpad_get_overseer_summarygala_launchpad_get_user_stats
Pitfalls: Overseer methods are high privilege; audit every call.
Related Topics: ban-management, global-bans, restricted-names
Content Flag Management
Key concept: Flags can be created, listed, dismissed, and actioned; comments have a dedicated topic.
When to use: Use for moderation queues and policy enforcement.
Covers methods: createFlag(), listFlags(), listGlobalFlags(), dismissFlag(), actionFlag()
import { ContentType, createLaunchpadSDK, FlagReason, FlagStatus } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const created = await sdk.createFlag({ tokenName: 'anime', contentType: ContentType.CHAT_MESSAGE, contentId: 'message-id', reportedUserAddress: 'eth|1234567890123456789012345678901234567890', reason: FlagReason.SPAM });
console.log(created, await sdk.listFlags({ tokenName: 'anime', status: FlagStatus.PENDING }));
// A moderator can action it: await sdk.actionFlag({ flagId: created.flag.id, action: 'DELETE_CONTENT' });
MCP Tool Equivalents:
gala_launchpad_create_flaggala_launchpad_list_flagsgala_launchpad_list_global_flagsgala_launchpad_dismiss_flaggala_launchpad_action_flag
Pitfalls: Use the action DTO accepted by the server and retain the flag ID.
Related Topics: comments, ban-management, ai-moderation
Content Reactions
Key concept: Content reactions distinguish generic content from chat-message and comment helpers.
When to use: Use for emoji reactions in social feeds and live chat.
Covers methods: addContentReaction(), removeContentReaction(), addReactionToChatMessage(), removeReactionFromChatMessage(), addReactionToComment(), removeReactionFromComment()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
await sdk.addReactionToChatMessage({ messageId: 'chat-message-id', reactionType: 'fire' });
await sdk.addReactionToComment({ messageId: 'comment-id', reactionType: 'heart' });
await sdk.removeReactionFromComment({ messageId: 'comment-id', reactionType: 'heart' });
MCP Tool Equivalents:
gala_launchpad_add_content_reactiongala_launchpad_remove_content_reactiongala_launchpad_add_reaction_to_chat_messagegala_launchpad_remove_reaction_from_chat_messagegala_launchpad_add_reaction_to_commentgala_launchpad_remove_reaction_from_comment
Pitfalls: Use the type-specific helper when the backend needs to resolve a message or comment.
Related Topics: comments, chat-messages, stream-chat
Trade History
Key concept: getTrades() supports filters and pagination for historical trades.
When to use: Use for account history, token activity, and audit views.
Covers methods: getTrades()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const result = await sdk.getTrades({ tokenName: 'anime', txnType: 'BUY', pageSize: 50 });
console.log(result.trades, result.pageInfo);
MCP Tool Equivalents:
gala_launchpad_get_trades
Pitfalls: Use pageInfo to continue pagination and keep amounts as strings.
Related Topics: recent-trades, trading-analytics, holders
Token Ban Management
Key concept: Overseer-only token-ban methods hide or restore tokens and expose current state.
When to use: Use in platform safety administration.
Covers methods: banToken(), unbanToken(), listTokenBans(), getTokenBan(), isTokenBanned()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
console.log(await sdk.isTokenBanned({ tokenName: 'anime' }));
console.log(await sdk.listTokenBans({ pageSize: 20 }));
MCP Tool Equivalents:
gala_launchpad_ban_tokengala_launchpad_unban_tokengala_launchpad_list_token_bansgala_launchpad_get_token_bangala_launchpad_is_token_banned
Pitfalls: Token bans are platform-wide moderation actions; require explicit authorization.
Related Topics: overseer-invites, restricted-names, content-flag-management
Nft Collection Management
Key concept: NFT collection, token-class, fee, mint, and balance methods remain flat SDK operations.
When to use: Use for collection administration and NFT portfolio flows.
Covers methods: getNftCollectionClaimFee(), getNftTokenClassCreateFee(), estimateNftMintFee(), estimateNftOperationFees(), isNftCollectionAvailable(), claimNftCollection(), fetchNftCollections(), createNftTokenClass(), fetchNftTokenClasses(), mintNft(), fetchNftBalances()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
console.log(await sdk.isNftCollectionAvailable('ExampleCollection'));
console.log(await sdk.getNftCollectionClaimFee(), await sdk.fetchNftCollections(sdk.getAddress()));
MCP Tool Equivalents:
gala_launchpad_check_nft_collection_availablegala_launchpad_get_nft_collection_claim_feegala_launchpad_fetch_nft_collectionsgala_launchpad_fetch_nft_balances
Pitfalls: Validate availability before writes and treat mint operations as wallet-authorized.
Related Topics: wallet-connect, balances, error-handling
Token Identification
Key concept: Launchpad methods use simple token names; GSwap methods use registered symbols or full TokenClassKeys.
When to use: Use before crossing from bonding-curve reads into DEX quotes or swaps.
Covers methods: fetchPools(), isTokenGraduated(), resolveTokenClassKey(), fetchTokenPrice()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const graduated = await sdk.isTokenGraduated('anime');
const tokenClassKey = await sdk.resolveTokenClassKey('anime');
console.log(graduated, tokenClassKey, await sdk.fetchTokenPrice({ tokenName: 'anime' }));
MCP Tool Equivalents:
gala_launchpad_fetch_poolsgala_launchpad_is_token_graduatedgala_launchpad_resolve_token_class_keygala_launchpad_fetch_token_spot_price
Pitfalls: Never hand-build a TokenClassKey.
Related Topics: graduation-detection, dex-token-discovery, dex-trading
Graduation Detection
Key concept: Check the explicit graduation flag and refresh pool metadata before selecting a trading surface.
When to use: Use at the boundary between bonding curve and DEX systems.
Covers methods: isTokenGraduated(), fetchPools(), onLaunchpadTokenCreation()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
const graduated = await sdk.isTokenGraduated('anime');
const pools = await sdk.fetchPools({ tokenName: 'anime', pageSize: 1 });
if (graduated) console.log('Trade it with a gswap-sdk GSwap client and the canonical key from pool data', pools);
MCP Tool Equivalents:
gala_launchpad_is_token_graduatedgala_launchpad_fetch_poolsgala_launchpad_on_launchpad_token_creation
Pitfalls: A DEX pool watch (gSwap.pools.watchNewPools) is not a replacement for a status read.
Related Topics: token-status, token-identification, pool-graduation
Ai Moderation
Key concept: Overseer-only AI methods manage settings, trigger analysis, read results, and inspect status.
When to use: Use in a protected moderation service before automated action.
Covers methods: getAIModerationSettings(), updateAIModerationSettings(), getAIModeration(), triggerAIModeration(), getAIModerationStatus()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
console.log(await sdk.getAIModerationSettings(), await sdk.getAIModerationStatus());
// Trigger only after policy review: await sdk.triggerAIModeration({ contentId: 'message-id', contentType: 'CHAT' });
MCP Tool Equivalents:
gala_launchpad_get_ai_moderation_settingsgala_launchpad_update_ai_moderation_settingsgala_launchpad_get_ai_moderation_resultgala_launchpad_trigger_ai_moderationgala_launchpad_get_ai_moderation_status
Pitfalls: AI output is a signal, not authorization to delete or ban without policy.
Related Topics: content-flag-management, ban-management, overseer-invites
Weekly Challenge
Key concept: Weekly challenge methods expose current rankings and token history snapshots.
When to use: Use for competition pages and historical token performance.
Covers methods: getWeeklyChallengeLeaderboard(), getTokenWeeklyHistory()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(await sdk.getWeeklyChallengeLeaderboard({ limit: 20 }));
console.log(await sdk.getTokenWeeklyHistory({ vaultAddress: 'client|example-token' }));
MCP Tool Equivalents:
gala_launchpad_get_weekly_challenge_leaderboardgala_launchpad_get_token_weekly_history
Pitfalls: Label snapshot timestamps rather than presenting them as live price data.
Related Topics: trading-analytics, platform-stats
Platform Stats
Key concept: getPlatformStats() returns platform-wide trading and token metrics.
When to use: Use for a public platform dashboard or operations summary.
Covers methods: getPlatformStats()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(await sdk.getPlatformStats());
MCP Tool Equivalents:
gala_launchpad_get_platform_stats
Pitfalls: Platform totals differ from an individual token’s trades or holder distribution.
Related Topics: trading-analytics, fetch-dex-aggregated-volume-summary
Restricted Names
Key concept: Overseer-only methods read and update the platform blocked-name list.
When to use: Use in controlled platform administration tooling.
Covers methods: getRestrictedNames(), updateRestrictedNames()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
console.log(await sdk.getRestrictedNames());
// Update only after approval: await sdk.updateRestrictedNames({ names: ['reserved-name'] });
MCP Tool Equivalents:
gala_launchpad_get_restricted_namesgala_launchpad_update_restricted_names
Pitfalls: Treat the list as policy configuration and validate the complete replacement payload.
Related Topics: overseer-invites, token-creation, token-ban-management
Websocket Admin
Key concept: Admin event emitters and connection inspection support platform realtime operations.
When to use: Use only from an authenticated overseer/admin service.
Covers methods: emitTradeExecuted(), emitStreamStatus(), emitChatMessage(), getConnectedClients(), isUserOnline(), getOnlineUsers()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
console.log(await sdk.getConnectedClients({}), await sdk.isUserOnline('eth|1234567890123456789012345678901234567890'));
// Emit only a validated payload: await sdk.emitChatStatus('anime', { enabled: true });
MCP Tool Equivalents:
gala_launchpad_get_connected_clientsgala_launchpad_is_user_onlinegala_launchpad_get_online_usersgala_launchpad_emit_chat_statusgala_launchpad_emit_websocket_event
Pitfalls: Emitters change live state seen by clients; validate payloads and permissions.
Related Topics: event-subscriptions, overseer-invites, stream-chat
Oembed
Key concept: OEmbed methods produce metadata for home, pool, and profile pages.
When to use: Use when a social platform requests a preview document.
Covers methods: getHomeOEmbed(), getPoolOEmbed(), getProfileOEmbed()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(await sdk.getHomeOEmbed());
console.log(await sdk.getPoolOEmbed({ tokenName: 'anime' }));
console.log(await sdk.getProfileOEmbed({ address: 'eth|1234567890123456789012345678901234567890' }));
MCP Tool Equivalents:
gala_launchpad_get_home_oembedgala_launchpad_get_pool_oembedgala_launchpad_get_profile_oembed
Pitfalls: Use SDK DTOs so canonical URLs and metadata stay aligned with the frontend.
Related Topics: token-details, profile-management
Messages
Key concept: The unified messages API handles CHAT and COMMENT records with one CRUD and pinning surface.
When to use: Use when an application wants one content abstraction.
Covers methods: fetchMessages(), createMessage(), updateMessage(), deleteMessage(), getPinnedMessage(), pinMessage(), unpinMessage(), getMessageStats()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const messages = await sdk.fetchMessages({ tokenName: 'anime', type: 'CHAT_MESSAGE', pageSize: 20 });
console.log(messages, await sdk.getMessageStats());
MCP Tool Equivalents:
gala_launchpad_fetch_messagesgala_launchpad_create_messagegala_launchpad_update_messagegala_launchpad_delete_messagegala_launchpad_get_pinned_messagegala_launchpad_pin_messagegala_launchpad_unpin_messagegala_launchpad_get_message_stats
Pitfalls: Use the message type explicitly and retain returned IDs.
Related Topics: comments, chat-messages, content-reactions
Holders
Key concept: Holder helpers provide top holders, counts, rank, balance ranges, and history.
When to use: Use for whale analysis and holder dashboards.
Covers methods: fetchTokenDistribution(), getTopHolders(), getHolderCount(), getHolderRank(), getHoldersByBalance(), getHolderHistory()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(await sdk.getTopHolders('anime', 10));
console.log(await sdk.getHolderCount('anime'));
console.log(await sdk.getHolderRank('anime', 'eth|1234567890123456789012345678901234567890'));
MCP Tool Equivalents:
gala_launchpad_get_top_holdersgala_launchpad_get_holder_countgala_launchpad_get_holder_rankgala_launchpad_get_holders_by_balancegala_launchpad_get_holder_history
Pitfalls: Holder results are point-in-time data; label timestamps and do not treat them as identity verification.
Related Topics: token-distribution, trade-history, balances
Trading Quotes
Key concept: Fee, sale-detail, trade-quote, and premint-quote methods provide planning data for Launchpad workflows.
When to use: Use before presenting cost estimates or constructing a bonding-curve operation.
Covers methods: fetchLaunchpadFee(), fetchSaleDetails(), getTradeQuote(), getPremintQuote()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(await sdk.fetchLaunchpadFee(), await sdk.fetchSaleDetails('anime'));
console.log(await sdk.getTradeQuote({ tokenName: 'anime', amount: '10', type: 'NATIVE', method: 'IN' }));
MCP Tool Equivalents:
gala_launchpad_fetch_launchpad_feegala_launchpad_fetch_sale_detailsgala_launchpad_get_trade_quotegala_launchpad_get_premint_quote
Pitfalls: A quote is informational until the matching write submits with slippage protection.
Related Topics: buy-tokens, sell-tokens, local-calculations
Global Feed Subscription
Key concept: The supported stream subscription API delivers realtime events; MCP also exposes a global-feed reference.
When to use: Use for a platform activity feed or realtime monitoring client.
Covers methods: subscribeToStream(), connectStreamWebSocket()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
await sdk.connectStreamWebSocket();
const subscription = await sdk.subscribeToStream('anime', { onStreamStatus: (event) => console.log(event), onReaction: (event) => console.log(event) });
console.log(subscription);
MCP Tool Equivalents:
gala_launchpad_global_feed_referencegala_launchpad_monitor_global_feed_events_referencegala_launchpad_connect_stream_websocketgala_launchpad_subscribe_to_stream
Pitfalls: Filter by token and event type; do not assume every event is a trade.
Related Topics: event-subscriptions, streaming, recent-trades
Events Tracking
Key concept: The SDK exposes a batching event service at sdk.events; track events and flush them at lifecycle boundaries.
When to use: Use for product analytics and durable client-event delivery when events are configured.
Covers methods: getConfig()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
sdk.events.track('token_viewed', { tokenName: 'anime' });
console.log(sdk.events.getStats());
await sdk.events.flush();
MCP Tool Equivalents:
gala_launchpad_get_configgala_launchpad_explain_sdk_usage
Pitfalls: Events are telemetry, not chain transactions; flush before shutdown and keep secrets out of payloads.
Related Topics: utilities-and-helpers, global-feed-subscription
Global Bans
Key concept: Global ban methods apply platform-wide moderation and are separate from token-scoped bans.
When to use: Use only in platform moderation administration.
Covers methods: getBanStats()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const ban = await sdk.createGlobalBan({ userAddress: 'eth|1234567890123456789012345678901234567890', reason: 'Repeated abuse' });
console.log(await sdk.getGlobalBan({ userAddress: ban.ban.userAddress }));
MCP Tool Equivalents:
gala_launchpad_global_feed_status_referencegala_launchpad_get_overseer_summary
Pitfalls: Global bans affect all communities; require a higher authorization threshold.
Related Topics: ban-management, overseer-invites, token-ban-management
Recent Trades
Key concept: getRecentTrades() is a compact activity query; use getTrades() for filters and deep paging.
When to use: Use for token pages and lightweight feeds.
Covers methods: getRecentTrades(), getTrades()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage' });
console.log(await sdk.getRecentTrades('anime', 10));
console.log(await sdk.getTrades({ tokenName: 'anime', txnType: 'BUY', pageSize: 20 }));
MCP Tool Equivalents:
gala_launchpad_get_recent_tradesgala_launchpad_get_trades
Pitfalls: Recent results are a convenience window, not a complete historical export.
Related Topics: trade-history, trading-analytics, global-feed-subscription
Queued Swap Recovery
Key concept: GSwap swap() returns a durable queued submission; confirmSwap(uniqueKey) resolves a persisted outcome without resubmitting.
When to use: Use after timeout, process restart, or unknown submission outcome.
Covers methods: gSwap.swaps.swap(), gSwap.swaps.confirmSwap()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
import { PrivateKeySigner } from '@gala-chain/gala-core-sdk';
import { GSwap } from '@gala-chain/gswap-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const gSwap = new GSwap({ env: 'stage', signer: new PrivateKeySigner(process.env.WALLET_PRIVATE_KEY!), walletAddress: sdk.getAddress() });
const quote = await gSwap.quoting.quoteExactInput('GALA|Unit|none|none', 'GUSDC|Unit|none|none', '10');
const submission = await gSwap.swaps.swap('GALA|Unit|none|none', 'GUSDC|Unit|none|none', quote.fee, { exactIn: '10', amountOutMinimum: quote.amountOut });
try { console.log(await submission.confirm()); } catch (error) { console.log('Recover with:', submission.uniqueKey, error); console.log(await gSwap.swaps.confirmSwap(submission.uniqueKey)); }
MCP Tool Equivalents:
gala_launchpad_execute_swapgala_launchpad_get_swap_result
Pitfalls: Recovery must use the original uniqueKey; never submit a second swap just because confirmation timed out.
Related Topics: dex-trading, error-handling
Comments
Key concept: Comments have a dedicated CRUD surface with token-scoped reads and explicit IDs.
When to use: Use for community discussion attached to a Launchpad pool.
Covers methods: getComments(), createComment(), updateComment(), deleteComment()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const comments = await sdk.getComments({ tokenName: 'anime', pageSize: 20 });
const created = await sdk.createComment({ tokenName: 'anime', content: 'Great project!' });
await sdk.updateComment(String(created.comment.id), { content: 'Updated comment' });
console.log(comments, created);
MCP Tool Equivalents:
gala_launchpad_get_commentsgala_launchpad_create_commentgala_launchpad_update_commentgala_launchpad_delete_comment
Pitfalls: Keep the comment ID; content IDs are not interchangeable across chat and comments.
Related Topics: content-reactions, content-flag-management, chat-messages
Chat Messages
Key concept: Chat-message CRUD is separate from the websocket transport used for live delivery.
When to use: Use for history views, moderation tools, and edits/deletes.
Covers methods: getChatMessages(), sendChatMessage(), updateChatMessage(), deleteChatMessage()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
const history = await sdk.getChatMessages({ tokenName: 'anime', pageSize: 20 });
const sent = await sdk.sendChatMessage({ tokenName: 'anime', content: 'Hello chat' });
await sdk.updateChatMessage(sent.message.messageId, { content: 'Edited hello' });
console.log(history, sent);
MCP Tool Equivalents:
gala_launchpad_get_chat_messagesgala_launchpad_send_chat_messagegala_launchpad_update_chat_messagegala_launchpad_delete_chat_message
Pitfalls: Use websocket methods for live delivery and durable CRUD methods for persistence.
Related Topics: stream-chat, comments, content-reactions
Notifications
Key concept: Push-token registration, notification preferences, and client flags support device-aware applications.
When to use: Use during device onboarding and settings changes.
Covers methods: registerPushToken(), unregisterPushToken(), fetchNotificationPreferences(), updateNotificationPreferences(), fetchClientFlags()
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({ env: 'stage', wallet: process.env.WALLET_PRIVATE_KEY! });
await sdk.registerPushToken({ token: 'device-token', platform: 'ios' });
console.log(await sdk.fetchNotificationPreferences(), await sdk.fetchClientFlags());
// Remove on sign-out: await sdk.unregisterPushToken('device-token');
MCP Tool Equivalents:
gala_launchpad_register_push_tokengala_launchpad_unregister_push_tokengala_launchpad_fetch_notification_preferencesgala_launchpad_update_notification_preferencesgala_launchpad_fetch_client_flags
Pitfalls: Treat device tokens as identifiers and unregister them on sign-out.
Related Topics: session-auth, profile-management, utilities-system