Exemple #1
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        /// <param name="identity"></param>
        /// <param name="guid"></param>
        private CCPCharacter(CharacterIdentity identity, Guid guid)
            : base(identity, guid)
        {
            QueryMonitors           = new QueryMonitorCollection();
            SkillQueue              = new SkillQueue(this);
            Standings               = new StandingCollection(this);
            Assets                  = new AssetCollection(this);
            WalletJournal           = new WalletJournalCollection(this);
            WalletTransactions      = new WalletTransactionsCollection(this);
            CharacterMarketOrders   = new MarketOrderCollection(this);
            CorporationMarketOrders = new MarketOrderCollection(this);
            CharacterContracts      = new ContractCollection(this);
            CorporationContracts    = new ContractCollection(this);
            CharacterIndustryJobs   = new IndustryJobCollection(this);
            CorporationIndustryJobs = new IndustryJobCollection(this);
            ResearchPoints          = new ResearchPointCollection(this);
            EVEMailMessages         = new EveMailMessageCollection(this);
            EVEMailingLists         = new EveMailingListCollection(this);
            EVENotifications        = new EveNotificationCollection(this);
            Contacts                = new ContactCollection(this);
            CharacterMedals         = new MedalCollection(this);
            CorporationMedals       = new MedalCollection(this);
            UpcomingCalendarEvents  = new UpcomingCalendarEventCollection(this);
            KillLog                 = new KillLogCollection(this);
            PlanetaryColonies       = new PlanetaryColonyCollection(this);
            LoyaltyPoints           = new LoyaltyCollection(this);

            m_endedOrdersForCharacter   = new List <MarketOrder>();
            m_endedOrdersForCorporation = new List <MarketOrder>();

            m_endedContractsForCharacter   = new List <Contract>();
            m_endedContractsForCorporation = new List <Contract>();

            m_jobsCompletedForCharacter = new List <IndustryJob>();
            m_allianceName    = EveIDToName.GetIDToName(AllianceID);
            m_corporationName = EveIDToName.GetIDToName(CorporationID);

            EveMonClient.CharacterAssetsUpdated           += EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated     += EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated   += EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated        += EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated      += EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated     += EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated   += EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted   += EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted  += EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.ESIKeyInfoUpdated  += EveMonClient_ESIKeyInfoUpdated;
            EveMonClient.EveIDToNameUpdated += EveMonClient_EveIDToNameUpdated;
            EveMonClient.TimerTick          += EveMonClient_TimerTick;
        }
Exemple #2
0
        public decimal GetBalance(MoneyUnit unit = MoneyUnit.BTC)
        {
            WalletTransactionsCollection transactions = null;
            Money amount = Money.Zero;

            try
            {
                transactions = _wallet.GetTransactions();
            }
            catch { }


            if (transactions != null && transactions.Count > 0)
            {
                amount = transactions.Summary.Spendable.Amount;
            }

            return(amount.ToUnit(unit));
        }
        static void Main(string[] args)
        {
            ExtKey         masterKey = new ExtKey();
            WalletCreation wc        = new WalletCreation
            {
                Network  = network,
                RootKeys = new [] { masterKey.Neuter() }
            };
            Wallet wallet = new Wallet(wc);

            wallet.Configure();

            NetworkAddress na = new NetworkAddress(IPAddress.Parse("127.0.0.1"), 18444);

            wallet.AddressManager.Add(na);
            wallet.Group.MaximumNodeConnection = 1;
            wallet.NewWalletTransaction       += (Wallet sender, WalletTransaction wtx) =>
            {
                WalletTransactionsCollection wtxc = wallet.GetTransactions();
                Console.WriteLine("wallet tx count => {0}", wtxc.Count);
                Console.WriteLine("immature => {0}", wtxc.Summary.Immature.Amount);
                Console.WriteLine("confirmed => {0}", wtxc.Summary.Confirmed.Amount);
                Console.WriteLine("unconfirmed => {0}", wtxc.Summary.UnConfirmed.Amount);
                Console.WriteLine("spendable => {0}", wtxc.Summary.Spendable.Amount);
            };
            wallet.Connect();

            BitcoinAddress addr = wallet.GetNextScriptPubKey().GetDestinationAddress(network);

            Console.WriteLine("receiver address => {0}", addr);

            Task.Run(() => {
                Console.WriteLine("wait a while before trigger tx ...");
                Thread.Sleep(2000);
                RPCClient client = new RPCClient("user:123456", "http://localhost:18443", network);
                uint256 txid     = client.SendToAddress(addr, Money.Coins(0.1m));
                Console.WriteLine("trigger txid => {0}", txid);
                client.Generate(1);
            });

            Console.ReadLine();
        }
Exemple #4
0
        public ICoin[] GetCoinSource()
        {
            WalletTransactionsCollection transactions = null;

            try
            {
                transactions = _wallet.GetTransactions();
            }
            catch { }


            if (transactions == null || transactions.Count == 0)
            {
                return(null);
            }
            else
            {
                return(transactions.GetSpendableCoins().ToArray());
            }
        }
Exemple #5
0
        /// <summary>
        /// Base constructor.
        /// </summary>
        /// <param name="identity"></param>
        /// <param name="guid"></param>
        private CCPCharacter(CharacterIdentity identity, Guid guid)
            : base(identity, guid)
        {
            QueryMonitors = new QueryMonitorCollection();
            SkillQueue = new SkillQueue(this);
            Standings = new StandingCollection(this);
            Assets = new AssetCollection(this);
            WalletJournal = new WalletJournalCollection(this);
            WalletTransactions = new WalletTransactionsCollection(this);
            CharacterMarketOrders = new MarketOrderCollection(this);
            CorporationMarketOrders = new MarketOrderCollection(this);
            CharacterContracts = new ContractCollection(this);
            CorporationContracts = new ContractCollection(this);
            CharacterContractBids = new ContractBidCollection(this);
            CorporationContractBids = new ContractBidCollection(this);
            CharacterIndustryJobs = new IndustryJobCollection(this);
            CorporationIndustryJobs = new IndustryJobCollection(this);
            ResearchPoints = new ResearchPointCollection(this);
            EVEMailMessages = new EveMailMessageCollection(this);
            EVEMailingLists = new EveMailingListCollection(this);
            EVENotifications = new EveNotificationCollection(this);
            Contacts = new ContactCollection(this);
            CharacterMedals = new MedalCollection(this);
            CorporationMedals = new MedalCollection(this);
            UpcomingCalendarEvents = new UpcomingCalendarEventCollection(this);
            KillLog = new KillLogCollection(this);
            PlanetaryColonies = new PlanetaryColonyCollection(this);

            m_endedOrdersForCharacter = new List<MarketOrder>();
            m_endedOrdersForCorporation = new List<MarketOrder>();

            m_endedContractsForCharacter = new List<Contract>();
            m_endedContractsForCorporation = new List<Contract>();

            m_jobsCompletedForCharacter = new List<IndustryJob>();

            EveMonClient.CharacterAssetsUpdated += EveMonClient_CharacterAssetsUpdated;
            EveMonClient.CharacterMarketOrdersUpdated += EveMonClient_CharacterMarketOrdersUpdated;
            EveMonClient.CorporationMarketOrdersUpdated += EveMonClient_CorporationMarketOrdersUpdated;
            EveMonClient.CharacterContractsUpdated += EveMonClient_CharacterContractsUpdated;
            EveMonClient.CorporationContractsUpdated += EveMonClient_CorporationContractsUpdated;
            EveMonClient.CharacterIndustryJobsUpdated += EveMonClient_CharacterIndustryJobsUpdated;
            EveMonClient.CorporationIndustryJobsUpdated += EveMonClient_CorporationIndustryJobsUpdated;
            EveMonClient.CharacterIndustryJobsCompleted += EveMonClient_CharacterIndustryJobsCompleted;
            EveMonClient.CorporationIndustryJobsCompleted += EveMonClient_CorporationIndustryJobsCompleted;
            EveMonClient.CharacterPlaneteryPinsCompleted += EveMonClient_CharacterPlaneteryPinsCompleted;
            EveMonClient.APIKeyInfoUpdated += EveMonClient_APIKeyInfoUpdated;
            EveMonClient.TimerTick += EveMonClient_TimerTick;
        }