index/variables/CALCULATION_MODES.md
constCALCULATION_MODES:object
Calculation mode constants for amount calculations
Type Declaration
| Name | Type | Description |
|---|---|---|
EXTERNAL | "external" | Network-based calculation via GalaChain (slower, always fresh) |
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
});