mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-29 08:35:49 +00:00
in isValidAddress check that address starting with 'r'
because UInt160 considers valid hex values
This commit is contained in:
@@ -12,7 +12,9 @@ const ValidationError = require('./errors').ValidationError;
|
||||
let SCHEMAS = {};
|
||||
|
||||
function isValidAddress(address: string): boolean {
|
||||
return core.UInt160.is_valid(address);
|
||||
return typeof address === 'string' && address.length > 0 &&
|
||||
address[0] === 'r' &&
|
||||
core.UInt160.is_valid(address);
|
||||
}
|
||||
|
||||
function isValidLedgerHash(ledgerHash) {
|
||||
|
||||
Reference in New Issue
Block a user