Created
February 8, 2019 06:11
-
-
Save donma/858dcb42b4289c7a549d0aa419064656 to your computer and use it in GitHub Desktop.
Check Wallet All Receive Coin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void CheckWalletAllReceiveCoin(string walletAddress) | |
{ | |
QBitNinja.Client.QBitNinjaClient client = new QBitNinja.Client.QBitNinjaClient(NBitcoin.Network.TestNet); | |
var balance = client.GetBalance(new NBitcoin.BitcoinPubKeyAddress(walletAddress), false).Result; | |
Console.WriteLine(""); | |
Console.WriteLine("TransactionId : BitCoin , Index"); | |
Console.WriteLine("-------------------------------------------"); | |
foreach (var operation in balance.Operations) | |
{ | |
Console.Write(operation.TransactionId + " : " + operation.ReceivedCoins.Select(coin => coin as NBitcoin.Coin).Sum(x => x.Amount.ToDecimal(NBitcoin.MoneyUnit.BTC)) + ","); | |
//To highline INDEX so chnage color . | |
Console.ForegroundColor = ConsoleColor.Green; | |
Console.WriteLine(string.Join(";", operation.ReceivedCoins.Select(coin => coin as NBitcoin.Coin).Select(x => x.Outpoint.N))); | |
Console.ForegroundColor = ConsoleColor.White; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CheckWalletAllReceiveCoin("mvJh993ZpnVFgX4Bs9jacjFLsKPhXj3nkj");