Files
pwap/shared/utils/validation.ts
T
Claude c48ded7ff2 Reorganize repository into monorepo structure
Restructured the project to support multiple frontend applications:
- Move web app to web/ directory
- Create pezkuwi-sdk-ui/ for Polkadot SDK clone (planned)
- Create mobile/ directory for mobile app development
- Add shared/ directory with common utilities, types, and blockchain code
- Update README.md with comprehensive documentation
- Remove obsolete DKSweb/ directory

This monorepo structure enables better code sharing and organized
development across web, mobile, and SDK UI projects.
2025-11-14 00:46:35 +00:00

29 lines
788 B
TypeScript

/**
* Validation utilities
*/
/**
* Validate if a string is a valid blockchain address
* @param address - Address to validate
* @returns True if valid, false otherwise
*/
export function isValidAddress(address: string): boolean {
// Basic validation - extend based on your blockchain requirements
if (!address) return false;
// Substrate/Polkadot addresses typically start with specific characters
// and have a specific length
return address.length >= 47 && address.length <= 48;
}
/**
* Validate if a string is a valid amount
* @param amount - Amount to validate
* @returns True if valid, false otherwise
*/
export function isValidAmount(amount: string): boolean {
if (!amount) return false;
const num = parseFloat(amount);
return !isNaN(num) && num > 0;
}