protected override void Run() { if (state.State == LedgerStatus.Updated) { var ledger = LedgerService.LedgerManager.GetSignedLedger(); AddressListener.OnLedgerUpdated(ledger); TransactionSubmissionListener.OnLedgerUpdated(ledger.Ledger); } }
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); }
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); }
public WalletService() { AddressListener = new AddressListener(); AliasManager = new AliasManager(); TransactionSubmissionListener = new TransactionSubmissionListener(); }