We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a65fd8b commit cf48a81Copy full SHA for cf48a81
packages/faucet/src/addresses.ts
@@ -6,9 +6,10 @@ import { fromBech32 } from "@cosmjs/encoding";
6
export function isValidAddress(input: string, requiredPrefix: string): boolean {
7
try {
8
const { prefix, data } = fromBech32(input);
9
- return (
10
- prefix === requiredPrefix && input.length >= 8 && input.length <= 90 && data.length >= 4 // 6 chars = 30 bits (3.75 bytes), rounded to whole byte
11
- );
+ if (prefix !== requiredPrefix) {
+ return false;
+ }
12
+ return data.length >= 20 && data.length <= 32;
13
} catch {
14
return false;
15
}
0 commit comments