示例#1
0
文件: Program.cs 项目: bwhli/MetrICX
        static void Main(string[] args)
        {
            //var device = FirebaseGateway.GetDevice("duzgt9Ubnxo:APA91bEYuVNGByPeAo292pIADQzOjTSA49Ly0ZKQ37INJdENTId1pn8HDHtAXQ3krRmoIEHIRaAvkIsYxADT0MGyZm58fQZGVebZz5DiUFRNLIAGd_mGR7XGnoVqGvqyjJBVAMucXaWw");
            //FirebaseGateway.UpdateDevice(device);

            ////device.addresses_v2.p0.tokens = new System.Collections.Generic.List<Token>() { new Token() {token = "TAP", contractAddress = "cxc0b5b52c9f8b4251a47e91dda3bd61e5512cd782" } };

            //ProcessDeviceAddress(device, device.addresses_v2.p0);

            //foreach (var token in device.addresses_v2.p0.tokens.AsEnumerator())
            //{
            //    ProcessDeviceToken(device, device.addresses_v2.p0, token);
            //}

            Console.WriteLine("[MAIN] STARTING APPLICATION TIMER v2.11");
            timer.Elapsed += Timer_Elapsed;
            timer.Interval = timerInterval * 1000;
            timer.Start();

            timerPrep.Elapsed += TimerPrep_Elapsed;
            timerPrep.Interval = timerPrepInterval * 1000;
            timerPrep.Start();

            AllPReps = IconGateway.GetAllPReps();

            while (true)
            {
                System.Threading.Thread.Sleep(1000);
            }
        }
示例#2
0
文件: Program.cs 项目: bwhli/MetrICX
 private static void TimerPrep_Elapsed(object sender, ElapsedEventArgs e)
 {
     timerPrep.Stop();
     try
     {
         Console.WriteLine("[MAIN] PREP TIMER ELAPSED, Checking all PReps");
         AllPReps = IconGateway.GetAllPReps();
         Console.WriteLine($"[MAIN] Retrieved {AllPReps.Preps.Count} P-Reps");
     }
     finally
     {
         timerPrep.Start();
     }
 }
示例#3
0
        public static PReps GetAllPReps()
        {
            Console.WriteLine($"[ICON] Getting all PReps");
            var call = new Call <PRepResult>(Consts.ApiUrl.MainNet);

            var result = call.Invoke(
                "hx0000000000000000000000000000000000000000",
                "cx0000000000000000000000000000000000000000",
                "getPReps"
                ).Result;

            var preps = new PReps(result);

            return(preps);
        }