/// <summary> /// This method gets the dynamic global properties from Steem /// </summary> /// <returns>Returns the retrieved data mapped to <see cref="GetDynamicGlobalPropertiesModel" /> class</returns> private GetDynamicGlobalPropertiesModel GetDynamicGlobalProperties() { var model = new GetDynamicGlobalPropertiesModel(); try { using (var csteemd = new CSteemd(ConfigurationHelper.HostName)) { var response = csteemd.get_dynamic_global_properties(); if (response != null) { var result = response.ToObject <GetDynamicGlobalPropertiesModel>(); if (result != null) { model = response.ToObject <GetDynamicGlobalPropertiesModel>(); } } } } catch (Exception ex) { _log.Error(ex); } return(model); }
public static decimal CalculateSteemPerMVests(GetDynamicGlobalPropertiesModel props) { decimal steemPerMVests = 0; var totalVestingSteem = Double.Parse(props.total_vesting_fund_steem.Replace("STEEM", "")); var totalVestingShares = Double.Parse(props.total_vesting_shares.Replace("VESTS", "")); steemPerMVests = (Decimal)(totalVestingSteem / (totalVestingShares / 1e6)); return(steemPerMVests); }