ICONationTeam
ICONationTeam
Agreed. We use the following code if that may help : ```js export const isICONAddress = function (address) { return /^(hx|cx)?[0-9a-f]{40}$/i.test(address) } export const isICONAddressContract = function (address) { return...
Actually I just noticed there are already methods for that implemented in the SDK : - Validator.isAddress - Validator.isEoaAddress - Validator.isScoreAddress https://github.com/icon-project/icon-sdk-js/blob/3ab30c0dbc2759cb480942b8463044fd0c89a703/lib/data/Validator.js#L59-L83
It can be done by sending a `ICONEX_RELAY.REQUEST` event, if you don't have any answer after 2 seconds, you can consider the extension as not installed. Exemple from the MyIconWallet...