Skip to main content

Function: validateMinMaxRelationship()

Gala Launchpad SDK 9.0.0-rc.5


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

Function: validateMinMaxRelationship()

validateMinMaxRelationship(min, max, minLabel, maxLabel): void

Defined in: packages/launchpad-sdk/dist/utils/validation-patterns.d.ts:746

Validates that min <= max constraint is satisfied.

Ensures that a minimum value does not exceed the maximum value. Supports both string and numeric inputs for flexibility.

Parameters​

min​

string | number

Minimum value (can be number or string)

max​

string | number

Maximum value (can be number or string)

minLabel​

string

Label for minimum value (e.g., 'minPrice') for error messages

maxLabel​

string

Label for maximum value (e.g., 'maxPrice') for error messages

Returns​

void

Throws​

If min > max

Examples​

// Valid: min < max
validateMinMaxRelationship(0.5, 1.0, 'minPrice', 'maxPrice');
// Valid: min = max
validateMinMaxRelationship(100, 100, 'minLiquidity', 'maxLiquidity');
// Invalid: min > max
validateMinMaxRelationship(10, 5, 'startTick', 'endTick'); // throws