/// <summary>
        /// Call API and retrieve a list of miner configurations used to start mining
        /// </summary>
        /// <returns></returns>
        private static List <MinerConfigResponse> GetMinerConfigurations()
        {
            // Build the Request to call the API and retrieve the miner config strings
            List <AccountWallet> accountWalletList             = new List <AccountWallet>();
            ObservableCollection <GPUSettings> gpuSettingsList = new ObservableCollection <GPUSettings>();
            Region region = Region.UNDEFINED;

            // Get configurations needed for building API request from Application settings
            accountWalletList = (List <AccountWallet>)Application.Current.Properties["AccountWalletList"];
            gpuSettingsList   = (ObservableCollection <GPUSettings>)Application.Current.Properties["GPUSettingsList"];
            region            = (Region)Application.Current.Properties["Region"];

            // Build actual Request object
            MinerConfigRequest minerConfigRequest = new MinerConfigRequest();

            minerConfigRequest.Region            = region;
            minerConfigRequest.AccountWalletList = accountWalletList;
            minerConfigRequest.GPUSettingsList   = gpuSettingsList.ToList();

            // Call the web API the get a response with a list of miner config strings used
            // to start one or more mining sessions based on the current miners configurations
            MinerConfigStringAPI       minerConfigStringAPI    = new MinerConfigStringAPI();
            List <MinerConfigResponse> minerConfigResponseList = minerConfigStringAPI.GetMinerConfigResponses(minerConfigRequest);

            return(minerConfigResponseList);
        }
Exemple #2
0
        /// <summary>
        /// Call API and retrieve a list of miner configurations used to start mining
        /// </summary>
        /// <returns></returns>
        private static List <MinerConfigResponse> GetMinerConfigurations(MinerAccount minerAccount)
        {
            // Build api Request object
            MinerConfigRequest minerConfigRequest = new MinerConfigRequest();

            minerConfigRequest.Region            = minerAccount.Region;
            minerConfigRequest.AccountWalletList = minerAccount.AccountWalletList;
            minerConfigRequest.GPUSettingsList   = minerAccount.GPUSettingsList.ToList();

            // Call the web API the get a response with a list of miner config strings used
            // to start one or more mining sessions based on the current miners configurations
            MinerConfigStringAPI       minerConfigStringAPI    = new MinerConfigStringAPI();
            List <MinerConfigResponse> minerConfigResponseList = minerConfigStringAPI.GetMinerConfigResponses(minerConfigRequest);

            return(minerConfigResponseList);
        }