@fordefi-public/crypto-address-validator-ts
Version:
Crypto address validator for Bitcoin and other Altcoins, forked to be used with typescript
16 lines • 607 B
JavaScript
import { getAll, getByNameOrSymbol } from './currencies';
export function validate(address, currencyNameOrSymbol, opts) {
var currency = getByNameOrSymbol(currencyNameOrSymbol);
if (currency && currency.validator) {
return currency.validator(address, currency, opts);
}
throw new Error('Missing validator for currency: ' + currencyNameOrSymbol);
}
export function getCurrencies() {
return getAll();
}
export function findCurrency(symbol) {
return getByNameOrSymbol(symbol) || null;
}
export default { validate, getCurrencies, findCurrency };
//# sourceMappingURL=index.js.map