@gala-chain/launchpad-sdk
v8.1.0
Published
TypeScript SDK for Gala Launchpad Backend API - 273 public methods supporting optional wallet (read-only and full-access modes). Production-ready DeFi token launchpad integration with AgentConfig setup, GalaChain trading, GSwap DEX integration, price hist
Readme
@gala-chain/launchpad-sdk
The SDK signs with @gala-chain/api and ethers; it does not depend on @gala-chain/connect.
The v6 TypeScript SDK for Gala Launchpad. It provides read APIs for launchpad data, typed launchpad submissions, gateway-backed token transactions, and the official GSwap DEX client through sdk.dex.
Install
pnpm add @gala-chain/launchpad-sdkThe v6 DEX surface delegates to @gala-chain/gswap-sdk. Until its rc is published to the public registry, install the unpublished rc from the sibling package or configure the workspace link used by this repository.
Configure
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
const sdk = createLaunchpadSDK({
env: 'stage',
baseUrl: 'https://lpad-backend.stage.defi.ovh.gala.com',
});
const pools = await sdk.fetchPools({ pageSize: 10 });
console.log(pools);Environment is 'prod' | 'stage'. The SDK defaults to prod; it does not infer an environment from a custom baseUrl. Use gatewayBaseUrl for the chain gateway override.
Launchpad writes
Launchpad buys, sells, and sale creation are submitted to the bundler. The result exposes bundleId, uniqueKey, and wait():
const submission = await sdk.launchpad.buyWithNative({
vaultAddress: 'client|example-token',
quantity: '1',
expectedAmount: '1',
});
const result = await submission.wait();
console.log(submission.bundleId, result);Token writes
Token transfers and other direct chain token operations go straight to the GalaChain gateway and return a ChainResult carrying status, data, and — read from the x-transaction-id and x-block-number response headers — transactionId and blockNumber:
const submission = await sdk.tokens.transfer({
tokenClassKey: 'GALA|Unit|none|none',
quantity: '1',
from: 'eth|0x0123456789012345678901234567890123456789',
to: 'eth|0x9876543210987654321098765432109876543210',
});
console.log(submission.transactionId, submission.blockNumber, submission.data);Never place a private key in source control. For a write-capable SDK, provide a signer through the supported wallet configuration.
GSwap DEX
DEX calls live under sdk.dex and use the @gala-chain/gswap-sdk contracts:
const quote = await sdk.dex.quoting.quoteExactInput(
'GALA|Unit|none|none',
'GUSDC|Unit|none|none',
'100',
);
const swap = await sdk.dex.swaps.swap(
'GALA|Unit|none|none',
'GUSDC|Unit|none|none',
quote.fee,
{ exactIn: '100', amountOutMinimum: quote.amountOut },
);
// The swap is queued (swap.mode === 'queued'); confirm() resolves the applied trade
// or throws the chain's rejection.
const applied = await swap.confirm();
console.log(applied.transactionId, applied.result);Use sdk.dex.pools, sdk.dex.positions, sdk.dex.symbols, and sdk.dex.assets for pool discovery, liquidity, token identifiers, and user assets. DEX reads are unsigned; state-changing DEX calls require the configured signer.
Hosts
The stage defaults are lpad-backend.stage.defi.ovh.gala.com for launchpad reads, swap-backend.stage.defi.ovh.gala.com for DEX reads, and gateway-testnet.galachain.com for gateway operations. Production host values are selected by env: 'prod'.
