Skip to main content

Interface: LaunchpadSDKConfig

Gala Launchpad SDK 9.0.0-rc.5


Gala Launchpad SDK 9.0.0-rc.5 / index / LaunchpadSDKConfig

Interface: LaunchpadSDKConfig

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:106

Configuration options for the SDK

Extends​

Properties​

accessToken?​

optional accessToken?: string

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:148

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

Inherited from​

SDKConfig.accessToken


accessTokenExpiresIn?​

optional accessTokenExpiresIn?: number

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:157

Access token expiration in seconds

Only used when accessToken is provided directly. Defaults to 86400 (24 hours) if not specified.

Since​

5.2.0

Inherited from​

SDKConfig.accessTokenExpiresIn


autoRefreshToken?​

optional autoRefreshToken?: boolean

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:169

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

Inherited from​

SDKConfig.autoRefreshToken


baseUrl?​

optional baseUrl?: string

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:129

Base URL for the API (defaults to the prod environment)

Inherited from​

SDKConfig.baseUrl


bridge?​

optional bridge?: CoreBridgeLoader

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:147

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?​

optional bundleBaseUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:196

Optional Bundle service URL override - defaults based on main API environment


bundleSocketFactory?​

optional bundleSocketFactory?: SocketFactory

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:134

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?​

optional calculateAmountMode?: "local" | "external"

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:217

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?​

optional debug?: boolean

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:135

Whether to enable debug logging

Inherited from​

SDKConfig.debug


devBypass?​

optional devBypass?: boolean

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:181

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

Inherited from​

SDKConfig.devBypass


dexApiBaseUrl?​

optional dexApiBaseUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:200

Optional DEX API URL override for launchpad token balances - defaults based on main API environment


dexBackendBaseUrl?​

optional dexBackendBaseUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:202

Optional DEX Backend URL override for price oracle - defaults based on main API environment


dexQuoteNetworkTimeout?​

optional dexQuoteNetworkTimeout?: number

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:233

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?​

optional env?: GalaChainEnv

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:127

Environment preset (automatically configures all URLs)

Inherited from​

SDKConfig.env


ethereumRpcUrl?​

optional ethereumRpcUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:273

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?​

optional events?: EventsConfig

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:220

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

Inherited from​

SDKConfig.events


galaChainAddress?​

optional galaChainAddress?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:257

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?​

optional gatewayBaseUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:194

Optional GalaChain gateway URL override - defaults based on main API environment


headers?​

optional headers?: Record<string, string>

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:133

Additional headers to include with requests

Inherited from​

SDKConfig.headers


httpRequestor?​

optional httpRequestor?: HttpRequestor

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:124

Fetch-compatible requestor used by v6 write surfaces and tests.


launchpadBaseUrl?​

optional launchpadBaseUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:206

Optional Launchpad API URL override used by launchpad write confirmation reads.


launchpadFrontendUrl?​

optional launchpadFrontendUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:204

Optional Launchpad Frontend URL override - defaults based on main API environment


maxAcceptableReverseBondingCurveFeeSlippageFactor?​

optional maxAcceptableReverseBondingCurveFeeSlippageFactor?: number

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:210

Optional global reverse bonding curve fee slippage factor (e.g., 0.01 = 1% fee slippage) - defaults to 0.01


pricingConcurrency?​

optional pricingConcurrency?: number

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:137

Concurrency level for pricing operations on liquidity positions (default: 5)

Inherited from​

SDKConfig.pricingConcurrency


session?​

optional session?: LaunchpadSession

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:120

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?​

optional signer?: LaunchpadSigner

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:108

Native or typed-data signer used by the v6 write surfaces.


slippageToleranceFactor?​

optional slippageToleranceFactor?: number

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:208

Optional global slippage tolerance factor (e.g., 0.05 = 5% slippage tolerance) - defaults to 0.15


solanaRpcUrl?​

optional solanaRpcUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:291

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?​

optional streamAdminApiKey?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:338

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

Overrides​

SDKConfig.streamAdminApiKey


streamReconnectAttempts?​

optional streamReconnectAttempts?: number

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:314

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?​

optional streamReconnectDelay?: number

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:321

The stream socket's delay before its first reconnection attempt in ms (default 2000; the delay grows toward streamReconnectDelayMax).

Since​

9.0.0


streamReconnectDelayMax?​

optional streamReconnectDelayMax?: number

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:327

The longest delay between the stream socket's reconnection attempts in ms (socket.io's default 5000).

Since​

9.0.0


streamWebSocketUrl?​

optional streamWebSocketUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:307

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
});

Overrides​

SDKConfig.streamWebSocketUrl


timeout?​

optional timeout?: number

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:131

Request timeout in milliseconds

Inherited from​

SDKConfig.timeout


userApiKey?​

optional userApiKey?: string

Defined in: packages/launchpad-sdk/dist/types/common.d.ts:210

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

Inherited from​

SDKConfig.userApiKey


wallet?​

optional wallet?: Wallet

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:157

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?​

optional walletAddress?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:122

Registered GalaChain address used as the write sender and bundler header.


walletProvider?​

optional walletProvider?: WalletProvider

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:192

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?​

optional webSocketUrl?: string

Defined in: packages/launchpad-sdk/dist/LaunchpadSDK.d.ts:198

Optional WebSocket URL override for transaction monitoring - defaults based on main API environment