Example #1
0
        public async Task <List <StakePool> > GetAllPoolsAsync()
        {
            var basePath = string.Format("http://localhost:{0}/v2", _port);

            Log.Verbose("Sending request for list all stake pools..");

            var stakePoolApi     = new StakePoolsApi(basePath);
            var alListStakePools = await stakePoolApi.ListStakePoolsAsync(0);

            Log.Information("Found {0} stake pools", alListStakePools.Count);

            var myStakePools = new List <StakePool>();

            foreach (var stakePoolApiResponse in alListStakePools)
            {
                myStakePools.Add(new StakePool(stakePoolApiResponse));
            }
            return(myStakePools);
        }
        public async Task <List <StakePool> > GetAllPoolsAsync()
        {
            var basePath = string.Format("http://localhost:{0}/v2", _port);

            Logging.Logger.LogInformation("Sending request for list all stake pools..");

            var alListStakePools = await ApiCallRetry <StakePoolApiResponse>(async delegate
            {
                var stakePoolApi = new StakePoolsApi(basePath);
                return(await stakePoolApi.ListStakePoolsAsync(0));
            });

            Logging.Logger.LogInformation("Found {0} stake pools", alListStakePools.Count);

            var sprdPoolInfos = await GetSprdPoolInfos();

            var myStakePools = new List <StakePool>();

            foreach (var stakePoolApiResponse in alListStakePools)
            {
                myStakePools.Add(new StakePool(stakePoolApiResponse, sprdPoolInfos));
            }
            return(myStakePools);
        }