public void ValidateAddress(string address)
        {
            var result  = _bitcoindClient.ValidateAddressAsync(address).Result;
            var result2 = _bitcoindClient.GetBalanceAsync(address).Result;
            var result3 = _bitcoindClient.GetListTransactionsAsync("first").Result;
            var result4 = _bitcoindClient.GetListWalletsAsync().Result;
            var result5 = _bitcoindClient.SendToAddressAsync(address, 1).Result;
            //_dataContext.Database.EnsureCreated();
            //var walls = _dataContext.HotWallets.ToList();

            //_dataContext.BulkInsertOrUpdate(parsedAddresses);
            //var newwalls = _dataContext.HotWallets.ToList();
        }
Beispiel #2
0
        public async Task <IActionResult> SendBtc([FromQuery] string address, [FromQuery] decimal amount, [FromQuery] string fromWallet = null)
        {
            if (!BitcoinHelper.CheckAddress(address) &&
                !(await _bitcoindClient.ValidateAddressAsync(address)).Isvalid)
            {
                return(StatusCode(400, $"invalid address ({address})"));
            }

            if (amount <= 0)
            {
                return(StatusCode(400, $"invalid amount ({amount})"));
            }

            await _bitcoindClient.SendToAddressAsync(address, amount, fromWallet);

            return(StatusCode(200));
        }