index/interfaces/LaunchpadSDKConfig.md
Configuration options for the SDK
Extends
sdk config
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
accessToken? | string | JWT 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? | number | Access 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? | boolean | Auto-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? | string | Base URL for the API (defaults to the prod environment) | - | SDKConfig.baseUrl |
bridge? | CoreBridgeLoader | Loads 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? | string | Optional Bundle service URL override - defaults based on main API environment | - | - |
bundleSocketFactory? | SocketFactory | The 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? | boolean | Whether to enable debug logging | - | SDKConfig.debug |
devBypass? | boolean | Enable 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? | string | Optional DEX API URL override for launchpad token balances - defaults based on main API environment | - | - |
dexBackendBaseUrl? | string | Optional DEX Backend URL override for price oracle - defaults based on main API environment | - | - |
dexQuoteNetworkTimeout? | number | Optional 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? | GalaChainEnv | Environment preset (automatically configures all URLs) | - | SDKConfig.env |
ethereumRpcUrl? | string | Optional 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? | EventsConfig | Events 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? | string | Optional 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? | string | Optional GalaChain gateway URL override - defaults based on main API environment | - | - |
headers? | Record<string, string> | Additional headers to include with requests | - | SDKConfig.headers |
httpRequestor? | HttpRequestor | Fetch-compatible requestor used by v6 write surfaces and tests. | - | - |
launchpadBaseUrl? | string | Optional Launchpad API URL override used by launchpad write confirmation reads. | - | - |
launchpadFrontendUrl? | string | Optional Launchpad Frontend URL override - defaults based on main API environment | - | - |
maxAcceptableReverseBondingCurveFeeSlippageFactor? | number | Optional global reverse bonding curve fee slippage factor (e.g., 0.01 = 1% fee slippage) - defaults to 0.01 | - | - |
pricingConcurrency? | number | Concurrency level for pricing operations on liquidity positions (default: 5) | - | SDKConfig.pricingConcurrency |
session? | LaunchpadSession | An 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? | LaunchpadSigner | Native or typed-data signer used by the v6 write surfaces. | - | - |
slippageToleranceFactor? | number | Optional global slippage tolerance factor (e.g., 0.05 = 5% slippage tolerance) - defaults to 0.15 | - | - |
solanaRpcUrl? | string | Optional 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? | string | Optional 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.0 | SDKConfig.streamAdminApiKey | - |
streamReconnectAttempts? | number | How 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? | number | The stream socket's delay before its first reconnection attempt in ms (default 2000; the delay grows toward streamReconnectDelayMax). Since 9.0.0 | - | - |
streamReconnectDelayMax? | number | The longest delay between the stream socket's reconnection attempts in ms (socket.io's default 5000). Since 9.0.0 | - | - |
streamWebSocketUrl? | string | Optional 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? | number | Request timeout in milliseconds | - | SDKConfig.timeout |
userApiKey? | string | Per-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? | Wallet | The 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? | string | Registered GalaChain address used as the write sender and bundler header. | - | - |
walletProvider? | WalletProvider | A 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? | string | Optional WebSocket URL override for transaction monitoring - defaults based on main API environment | - | - |
access token sdk config expires in auto refresh base url core bridge loader out wrap get supported tokens configuration error bundle socket factory calculate amount mode dev bypass dex api backend quote network timeout launchpad gala chain env ethereum rpc your key events address lowercase admin gateway http requestor frontend max acceptable reverse bonding curve fee slippage factor pricing concurrency session wallet provider signer tolerance solana stream reconnect attempts delay web environment user private external detect wallets