Skip to main content

Variable: CALCULATION\_MODES

Gala Launchpad SDK 9.0.0-rc.5


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

Variable: CALCULATION_MODES

const CALCULATION_MODES: object

Defined in: packages/launchpad-sdk/dist/constants/enums.d.ts:78

Calculation mode constants for amount calculations

Type Declaration​

EXTERNAL​

readonly EXTERNAL: "external"

Network-based calculation via GalaChain (slower, always fresh)

LOCAL​

readonly LOCAL: "local"

Client-side bonding curve calculation (instant, no network calls)

Example​

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

// Use local mode for instant calculations
await sdk.calculateBuyAmount({
tokenName: 'anime',
amount: '100',
type: 'exact',
mode: CALCULATION_MODES.LOCAL
});

// Use external mode for network-based calculations
await sdk.calculateBuyAmount({
tokenName: 'anime',
amount: '100',
type: 'exact',
mode: CALCULATION_MODES.EXTERNAL
});