Files
memecoin-botV2/.pnpm-store/v10/files/a2/3fd68a3867816e69a07d5c554e6181ff5647a647d843d635a27a447b56cbeefb26c06ce8b2a25e57fa2537a0c4df482688b005ef59a0c3eee4a5370948b006

27 lines
1008 B
Plaintext

/**
* Ensures that a given number falls within a specified range.
*
* If the number is outside the allowed range, an error is thrown.
* This function is primarily used to validate values before encoding them in a codec.
*
* @param codecDescription - A string describing the codec that is performing the validation.
* @param min - The minimum allowed value (inclusive).
* @param max - The maximum allowed value (inclusive).
* @param value - The number to validate.
*
* @throws {@link SolanaError} if the value is out of range.
*
* @example
* Validating a number within range.
* ```ts
* assertNumberIsBetweenForCodec('u8', 0, 255, 42); // Passes
* ```
*
* @example
* Throwing an error for an out-of-range value.
* ```ts
* assertNumberIsBetweenForCodec('u8', 0, 255, 300); // Throws
* ```
*/
export declare function assertNumberIsBetweenForCodec(codecDescription: string, min: bigint | number, max: bigint | number, value: bigint | number): void;
//# sourceMappingURL=assertions.d.ts.map