Exemple #1
0
        public Address(AddressPrefix prefix, byte[] body)
        {
            if (!IconKeys.IsValidAddressBody(body))
            {
                throw new ArgumentException("Invalid address");
            }

            _prefix = prefix;
            _body   = body;
        }
Exemple #2
0
        public Address(string address)
        {
            var addressPrefix = IconKeys.GetAddressHexPrefix(address);

            if (addressPrefix == null)
            {
                throw new ArgumentException("Invalid address prefix");
            }
            else if (!IconKeys.IsValidAddress(address))
            {
                throw new ArgumentException("Invalid address");
            }

            _prefix = addressPrefix;
            _body   = GetAddressBody(address);
        }