Skip to main content

Function: createLaunchpadSDK()

Gala Launchpad SDK 9.0.0-rc.5


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

Function: createLaunchpadSDK()

createLaunchpadSDK(options?): LaunchpadSDK

Defined in: packages/launchpad-sdk/dist/helpers/sdk.d.ts:61

Creates a fully configured LaunchpadSDK instance with smart defaults

This factory function simplifies SDK initialization by:

  • Auto-detecting wallet input format (private key, mnemonic, or Wallet instance)
  • Providing smart environment-based defaults
  • Handling wallet creation automatically

Parameters​

options?​

Configuration options

config?​

Partial<LaunchpadSDKConfig>

Additional SDK configuration options

env?​

GalaChainEnv

Environment preset ('prod' or 'stage') for automatic URL configuration

wallet?​

string | Wallet

Wallet input (private key string, mnemonic string, or Wallet instance)

Returns​

LaunchpadSDK

Fully configured LaunchpadSDK instance

Example​

import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';

// Generate new random wallet and create SDK with stage environment
const sdk = createLaunchpadSDK();

// From private key with environment
const sdkFromPk = createLaunchpadSDK({
wallet: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef12',
env: 'prod'
});

// From mnemonic with config
const sdkFromMnemonic = createLaunchpadSDK({
wallet: 'word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12',
env: 'stage',
config: {
debug: true,
timeout: 60000
}
});

// With URL overrides
const sdkWithOverrides = createLaunchpadSDK({
wallet: process.env.PRIVATE_KEY,
env: 'prod',
config: {
gatewayBaseUrl: 'https://custom-gateway.example.com'
}
});

// Ready to use immediately
const balance = await sdk.user.getGalaBalance({ walletAddress: sdk.getAddress() });