Exemplo n.º 1
0
        // the other way to do this, is to index addresses per alias when the item is aliased
        public Address GetAddress_(string text)
        {
            if (text.Length == Address.ENCODED_SIZE)
            {
                return(new Address(text));
            }

            IAliased item;

            if (!AliasManager.TryGetByAlias(text, out item))
            {
                return(null);
            }

            var declaration = item.GetObject <TxAddressDeclaration>();

            if (declaration != null)
            {
                return(declaration.Address);
            }

            var wallet = item.GetObject <PrivateKeyNotWallet>();

            if (wallet != null)
            {
                return(wallet.Address);
            }

            return(null);
        }
Exemplo n.º 2
0
 public bool SetActiveKey(string alias)
 {
     if (!AliasManager.TryGetByAlias(alias, out Aliased <PrivateKeyNotWallet> wallet))
     {
         return(false);
     }
     active = wallet;
     return(true);
 }