@wasserstoff/tribes-sdk
Version:
SDK for integrating with Tribes by Astrix platform on any EVM compatible chain
54 lines (53 loc) • 1.95 kB
TypeScript
/**
* Validate an Ethereum address
* @param address Address to validate
* @param paramName Parameter name for error messages
* @throws AstrixSDKError if the address is invalid
*/
export declare function validateAddress(address: string, paramName?: string): void;
/**
* Validate a number is positive
* @param value Value to validate
* @param paramName Parameter name for error messages
* @throws AstrixSDKError if the value is not positive
*/
export declare function validatePositiveNumber(value: number, paramName?: string): void;
/**
* Validate a bigint is positive
* @param value Value to validate
* @param paramName Parameter name for error messages
* @throws AstrixSDKError if the value is not positive
*/
export declare function validatePositiveBigInt(value: bigint, paramName?: string): void;
/**
* Validate a string is not empty
* @param value Value to validate
* @param paramName Parameter name for error messages
* @throws AstrixSDKError if the string is empty
*/
export declare function validateNonEmptyString(value: string, paramName?: string): void;
/**
* Validate an array is not empty
* @param array Array to validate
* @param paramName Parameter name for error messages
* @throws AstrixSDKError if the array is empty
*/
export declare function validateNonEmptyArray(array: unknown[], paramName?: string): void;
/**
* Validate a token amount
* @param amount Amount to validate
* @param paramName Parameter name for error messages
* @throws AstrixSDKError if the amount is invalid
*/
export declare function validateTokenAmount(amount: bigint, paramName?: string): void;
/**
* Validate tribe parameters
* @param tribeId Tribe ID to validate
* @throws AstrixSDKError if the tribe ID is invalid
*/
export declare function validateTribeId(tribeId: number): void;
/**
* Check if a value is an object
* @param obj Object to check
*/
export declare function isObject(obj: Record<string, unknown>): boolean;