Skip to main content

index/interfaces/LaunchpadSDKConfig.md

Configuration options for the SDK

Extends​

Properties​

PropertyTypeDescriptionOverridesInherited from
accessToken?stringJWT access token for authenticated requests If provided, the SDK will use this token for JWT-protected endpoints without requiring login(). Token will be auto-refreshed before expiry. Alternative: Call sdk.login() to authenticate with wallet signature. Since 5.2.0-SDKConfig.accessToken
accessTokenExpiresIn?numberAccess token expiration in seconds Only used when accessToken is provided directly. Defaults to 86400 (24 hours) if not specified. Since 5.2.0-SDKConfig.accessTokenExpiresIn
autoRefreshToken?booleanAuto-refresh JWT before expiry When enabled (default), the SDK will automatically refresh the JWT token before it expires during requests to JWT-protected endpoints. Refresh occurs when token expires within 5 minutes of request time. Default true Since 5.2.0-SDKConfig.autoRefreshToken
baseUrl?stringBase URL for the API (defaults to the prod environment)-SDKConfig.baseUrl
bridge?CoreBridgeLoaderLoads gala-core-sdk's ./bridge, which the bridge and wrap methods (bridgeOut, bridgeIn, wrapToken, getSupportedBridgeTokens, the external-chain balances, ...) run on: bridge: () => import('@gala-chain/gala-core-sdk/bridge'). That module loads ethers, @solana/web3.js and @solana/spl-token (core's optional peers), so launchpad-sdk never names it itself: an app that does not pass this loader bundles and installs no Solana, and its bridge and wrap calls throw a ConfigurationError naming this option. Loaded once per SDK, at the first such call; a failed load (the peers are not installed) is a ConfigurationError naming them, tried again at the next call. Since 9.0.0--
bundleBaseUrl?stringOptional Bundle service URL override - defaults based on main API environment--
bundleSocketFactory?SocketFactoryThe app's own bundler socket (socket.io to the bundle backend, with the app's reconnect settings), for the confirmation of sdk.launchpad writes. Called once per wait() with the bundle base URL; the SDK adds its listener for the bundle's event on the socket returned and removes it when the wait ends, and never disconnects it. Without it each wait() opens a socket of its own and closes it afterwards. Since 9.0.0--
calculateAmountMode?"local" | "external"Default calculation mode for amount calculations. 'local' = Client-side bonding curve (instant, no network calls) 'external' = Network calls to GalaChain (slower, always fresh) Default 'local'--
debug?booleanWhether to enable debug logging-SDKConfig.debug
devBypass?booleanEnable development bypass mode (STAGE only) When enabled in STAGE environment, JWT authentication can be bypassed by appending ?bypass={address} to requests. Useful for testing. WARNING: Only works in STAGE environment. Has no effect in PROD. Default false Since 5.2.0-SDKConfig.devBypass
dexApiBaseUrl?stringOptional DEX API URL override for launchpad token balances - defaults based on main API environment--
dexBackendBaseUrl?stringOptional DEX Backend URL override for price oracle - defaults based on main API environment--
dexQuoteNetworkTimeout?numberOptional network timeout for DEX quote API calls (in milliseconds). Use for rate-limited APIs or networks with high latency. Default 30000 (30 seconds) Min 1000 Max 300000 Example // Increase timeout for rate-limited API const sdk = new LaunchpadSDK({ wallet, dexQuoteNetworkTimeout: 60000 // 60 seconds });--
env?GalaChainEnvEnvironment preset (automatically configures all URLs)-SDKConfig.env
ethereumRpcUrl?stringOptional Ethereum RPC URL override for bridge operations. If not provided, defaults to Gala internal endpoints: - prod: https://eth.gala.games - stage: https://dev.eth.gala.games Example const sdk = new LaunchpadSDK({ wallet, ethereumRpcUrl: 'https://mainnet.infura.io/v3/YOUR_KEY' });--
events?EventsConfigEvents tracking and batching configuration Configure client-side event batching for SDK events ingestion. Events are automatically buffered and flushed in configurable batches to the backend, reducing network overhead. Since 8.2.0-SDKConfig.events
galaChainAddress?stringOptional GalaChain address override. If not provided, the address is derived as eth|{lowercase_ethereum_address} from the wallet's private key. Use for non-standard addresses that cannot be derived from a private key, such as system accounts (client|ops-admin) or special-purpose addresses. Example // Standard usage - address derived from wallet const sdk = new LaunchpadSDK({ wallet }); sdk.getAddress(); // "eth|a1b2c3d4..." // Override for system account const adminSdk = new LaunchpadSDK({ wallet, galaChainAddress: 'client|ops-admin' }); adminSdk.getAddress(); // "client|ops-admin"--
gatewayBaseUrl?stringOptional GalaChain gateway URL override - defaults based on main API environment--
headers?Record<string, string>Additional headers to include with requests-SDKConfig.headers
httpRequestor?HttpRequestorFetch-compatible requestor used by v6 write surfaces and tests.--
launchpadBaseUrl?stringOptional Launchpad API URL override used by launchpad write confirmation reads.--
launchpadFrontendUrl?stringOptional Launchpad Frontend URL override - defaults based on main API environment--
maxAcceptableReverseBondingCurveFeeSlippageFactor?numberOptional global reverse bonding curve fee slippage factor (e.g., 0.01 = 1% fee slippage) - defaults to 0.01--
pricingConcurrency?numberConcurrency level for pricing operations on liquidity positions (default: 5)-SDKConfig.pricingConcurrency
session?LaunchpadSessionAn app-owned launchpad-backend session (a browser app's httpOnly-cookie JWT session). Every launchpad-backend request then takes its bearer from the session, a 401 is handed to the session (one retry with the token it returns), those requests carry the browser's cookies, and the SDK stores no token: log in with LaunchpadSDK.loginWithSignature, refresh with LaunchpadSDK.refreshToken, end it with LaunchpadSDK.logout. Exclusive with accessToken. Pair it with signer + walletAddress (never wallet / walletProvider, which sign every request). Since 9.0.0--
signer?LaunchpadSignerNative or typed-data signer used by the v6 write surfaces.--
slippageToleranceFactor?numberOptional global slippage tolerance factor (e.g., 0.05 = 5% slippage tolerance) - defaults to 0.15--
solanaRpcUrl?stringOptional Solana RPC URL override for bridge operations. If not provided, defaults to public Solana endpoints: - prod: https://api.mainnet-beta.solana.com - stage: https://api.devnet.solana.com For faster/more reliable operations, use a dedicated RPC provider like Helius. Example const sdk = new LaunchpadSDK({ wallet, solanaRpcUrl: 'https://devnet.helius-rpc.com/?api-key=YOUR_KEY' });--
streamAdminApiKey?stringOptional Admin API key for stream management operations. Required for admin-only operations: - Disabling/enabling streams per token - Disabling/enabling streaming globally - Disabling/enabling chat per token or globally Since 5.1.0SDKConfig.streamAdminApiKey-
streamReconnectAttempts?numberHow many times the stream socket retries a lost connection before giving up (default 5; Infinity never gives up, which is what a long-lived browser app wants). Since 9.0.0--
streamReconnectDelay?numberThe stream socket's delay before its first reconnection attempt in ms (default 2000; the delay grows toward streamReconnectDelayMax). Since 9.0.0--
streamReconnectDelayMax?numberThe longest delay between the stream socket's reconnection attempts in ms (socket.io's default 5000). Since 9.0.0--
streamWebSocketUrl?stringOptional Stream WebSocket URL for live streaming features. This is a SEPARATE endpoint from bundleBaseUrl, dedicated to streaming operations. Required for real-time stream status, viewer count, and chat functionality. Since 5.1.0 Example const sdk = new LaunchpadSDK({ wallet, streamWebSocketUrl: getEnvironmentConfig('stage').launchpadBaseUrl });SDKConfig.streamWebSocketUrl-
timeout?numberRequest timeout in milliseconds-SDKConfig.timeout
userApiKey?stringPer-user API key for MultiAuthGuard endpoints If provided, the SDK will use this key for endpoints protected by MultiAuthGuard (bans, moderators, content flags) as an alternative to JWT authentication. Created via sdk.createApiKey(). Priority: userApiKey > JWT (for MultiAuthGuard endpoints only). Does NOT apply to AdminOrOverseerGuard endpoints (use streamAdminApiKey for those). Since 9.1.0-SDKConfig.userApiKey
wallet?WalletThe ethers wallet for authentication (optional) - Required for: Trading (buy/sell), transfers, token creation, profile updates - Optional for: Pool queries, price fetches, balance checks, calculations, metadata retrieval If not provided, SDK operates in read-only mode. Call setWallet() later to enable signing operations. Deprecated Use walletProvider instead for browser wallet support--
walletAddress?stringRegistered GalaChain address used as the write sender and bundler header.--
walletProvider?WalletProviderA WalletProvider for authentication (optional) Supports both private key and browser extension wallets (MetaMask, Coinbase, etc.). - Required for: Trading (buy/sell), transfers, token creation, profile updates - Optional for: Pool queries, price fetches, balance checks, calculations, metadata retrieval If not provided, SDK operates in read-only mode. Examples Using private key (Node.js/CLI) import { PrivateKeyProvider } from '@gala-chain/gala-core-sdk/providers'; const provider = new PrivateKeyProvider('0x...'); const sdk = new LaunchpadSDK({ walletProvider: provider, env: 'prod' }); Using browser wallet (React/Vue) import { ExternalWalletProvider, detectWallets } from '@gala-chain/gala-core-sdk/providers'; const { wallets } = await detectWallets(); const provider = new ExternalWalletProvider(wallets[0].provider); await provider.connect(); const sdk = new LaunchpadSDK({ walletProvider: provider, env: 'prod' });--
webSocketUrl?stringOptional WebSocket URL override for transaction monitoring - defaults based on main API environment--