Bitcoin
A$ 82,413
WINkLink
A$ 0.0008273
Ethereum
A$ 5,572.9

NBitcoin how to send a transaction?

The verification passed. But nothing happen after that. The balance in both accounts remain the same.

Anything wrong in the way that I build my transaction?

var fpk = new BitcoinSecret("<my private key>", Network.TestNet);
var fspk = fpk.GetAddress(ScriptPubKeyType.Legacy);
var api = new QBitNinjaClient("http://tapi.qbit.ninja/", fpk.Network);
var fbal = await api.GetBalance(fspk, true);
var fcoin = new List<ICoin>();
foreach (var o in fbal.Operations)
{
    if (o.Confirmations < 2) continue; // 2 confirmations
    fcoin.AddRange(o.ReceivedCoins);
}

var builder = fpk.Network.CreateTransactionBuilder();
var tx = builder
    .AddCoins(fcoin)
    .AddKeys(fpk)
    .Send(new BitcoinPubKeyAddress("<To address>", fpk.Network), Money.Coins(0.001))
    .SubtractFees()
    .SendFees(Money.Coins(0.00001))
    .SetChange(fpk)
    .BuildTransaction(true);

Debug.Assert(builder.Verify(tx));

Related Posts

Leave a Reply

Subscribe To Newsletter

For updates and exclusive offers, enter your e-mail below.

Donate To Cryptonic Australia


Donate BTC: 1MPYuHUKm3AhNivMSngqLnoEbpNEecHeEK
Donate Doge: DDYybw7H8zx8EYU74JrGW8WwmYh9AGuyMC
Donate WinK: TDiXutqKE3P17LpZMQh3SDBCGSkAC6iEjB




How can I build an iOS wallet app for altcoin?
October 24, 2021
Avalanche (AVAX) Founder: Stablecoin Adoption Will Mark The Success of the Crypto Trade
October 24, 2021
What number of characters of an handle do I truly must confirm?
October 23, 2021




How can I build an iOS wallet app for altcoin?
October 24, 2021
Avalanche (AVAX) Founder: Stablecoin Adoption Will Mark The Success of the Crypto Trade
October 24, 2021
What number of characters of an handle do I truly must confirm?
October 23, 2021


CryptoCurrencyAUDChange 1hChange 24hChange 7d
Bitcoin82,413 0.49 % 0.38 % 0.56 %
Ethereum5,572.9 0.34 % 3.03 % 7.91 %
Binance Coin652.17 0.35 % 0.97 % 4.05 %
Tether1.350 0.39 % 0.34 % 0.24 %
Cardano2.900 0.21 % 0.17 % 0.95 %
Solana264.78 0.20 % 2.60 % 24.86 %
XRP1.470 0.39 % 0.36 % 3.81 %
Polkadot58.99 0.10 % 1.02 % 4.91 %
Dogecoin0.3367 0.78 % 1.82 % 5.35 %
USD Coin1.350 0.14 % 0.34 % 0.32 %

Recent Comments

Allison wick

I was a victim of WDC Markets investment scam some months ago myself. It was...

Greatness

he is the best when it comes to recovery, he helped recover my funds without...

URL

... [Trackback] [...] There you will find 63491 more Infos: cryptonic.com.au/evaluation-suggests-bitcoin-robust-palms-are-shopping-for-this-dip/ [...]