@dartess/multicoin-address-validator
Version:
Multicoin address validator for Bitcoin and other Altcoins ported to TypeScript.
15 lines (14 loc) • 602 B
TypeScript
import { OptsNetworkTypeOptional } from '../types';
declare function decode(hrp: string, addr: string): {
version: number;
program: number[];
} | null;
declare function encode(hrp: string, version: number, program: Array<number>): string | null;
declare type NetworkType = 'prod' | 'testnet' | string;
declare function isValidAddress(address: string, currency: Record<string, any>, opts?: OptsNetworkTypeOptional<NetworkType>): boolean;
declare const segwit: {
encode: typeof encode;
decode: typeof decode;
isValidAddress: typeof isValidAddress;
};
export { segwit };