Skip to main content

Function: validatePriceValues

validatePriceValues(spotPrice, lowerPrice, upperPrice): void

Validates a spot price and a lower/upper price range: none a JavaScript number, all positive and finite (a non-finite upper bound counts as an unbounded 1e18), and lowerPrice <= upperPrice.

Parameters​

ParameterType
spotPriceNumericAmount
lowerPriceNumericAmount
upperPriceNumericAmount

Returns​

void

Throws​

GSwapSDKError PRICE_VALUES_IS_JS_NUMBER, INVALID_PRICE_VALUES or INVALID_PRICE_RANGE.