diff --git a/src/currencies.js b/src/currencies.js index 5a12f0e3..9bcdbaec 100644 --- a/src/currencies.js +++ b/src/currencies.js @@ -3,6 +3,7 @@ var ETHValidator = require('./ethereum_validator'); var BTCValidator = require('./bitcoin_validator'); var XMRValidator = require('./monero_validator'); var NANOValidator = require('./nano_validator'); +var ICXValidator = require('./icon_validator'); // defines P2PKH and P2SH address types for standard (prod) and testnet networks var CURRENCIES = [{ @@ -209,6 +210,10 @@ var CURRENCIES = [{ name: 'raiblocks', symbol: 'xrb', validator: NANOValidator, +},{ + name: 'icon', + symbol: 'icx', + validator: ICXValidator, }]; diff --git a/src/icon_validator.js b/src/icon_validator.js new file mode 100644 index 00000000..733b50a1 --- /dev/null +++ b/src/icon_validator.js @@ -0,0 +1,5 @@ +module.exports = { + isValidAddress: function(address) { + return /^(hx)[0-9a-f]{40}$/i.test(address); + } +};