예제 #1
0
 protected override void Run()
 {
     if (state.State == LedgerStatus.Updated)
     {
         var ledger = LedgerService.LedgerManager.GetSignedLedger();
         AddressListener.OnLedgerUpdated(ledger);
         TransactionSubmissionListener.OnLedgerUpdated(ledger.Ledger);
     }
 }
예제 #2
0
        public bool ImportPrivateKey(string label, PrivateKeyNotWallet key)
        {
            var aliased = AliasManager.SetAlias(label, key);
            var address = key.Address.Encoded;

            if (wallets.ContainsKey(label))
            {
                return(false);
            }
            wallets.Add(address, aliased);
            AddressListener.Listen(key.Address);
            return(true);
        }
예제 #3
0
        public bool ImportDeclaration(string alias, TxDeclaration declaration)
        {
            AliasManager.SetAlias(alias, declaration);
            if (declarations.ContainsKey(alias))
            {
                return(false);
            }
            declarations.Add(alias, declaration);

            if (declaration is TxAddressDeclaration)
            {
                var address = ((TxAddressDeclaration)declaration).Address;
                AliasManager.SetAlias(address.Encoded, declaration);
                if (declarations.ContainsKey(address.Encoded))
                {
                    return(false);
                }
                declarations.Add(address.Encoded, declaration);

                AddressListener.Listen(address);
            }
            return(true);
        }
예제 #4
0
 public WalletService()
 {
     AddressListener = new AddressListener();
     AliasManager    = new AliasManager();
     TransactionSubmissionListener = new TransactionSubmissionListener();
 }