rendered paste bodyusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bitnet.Dal;
namespace MyEscrow.Dal.OfficialBitcoinProvider
{
/// <summary>
/// Mixin used to provide support for official bitcoin client API
/// </summary>
public static class BitcoinProvider
{
public static decimal GetRecievedByEscrowAddress(this BitCoinEscrowAccount account)
{
decimal payment = DbProvider.GetBc(account.IsTestAccount).GetReceivedByAddress(account.EscrowAccountAddress);
return payment;
}
public static decimal GetRecievedByCommandAddress(this BitCoinEscrowAccount account)
{
decimal payment = DbProvider.GetBc(account.IsTestAccount).GetReceivedByAddress(account.EscrowCommandAddress);
return payment;
}
public static string GetNewAddress(this BitCoinEscrowAccount account)
{
return DbProvider.GetBc(account.IsTestAccount).GetNewAddress("");
}
public static void SendBitCoinsToAddress(this BitCoinEscrowAccount account, string address, decimal amount)
{
DbProvider.GetBc(account.IsTestAccount).SendToAddress(address, amount, "", "");
}
public static bool ValidateAddress(this BitCoinEscrowAccount account, string address)
{
var foo = DbProvider.GetBc(account.IsTestAccount).ValidateAddress(address);
bool isValid = bool.Parse(foo["isvalid"].ToString());
return isValid;
}
}
}