mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Show Immature Balance in walletsend page (#2731)
* Wallet Send page also shows immature balance * changes ans to and * Immature Balance msg is not tooltip * Make msg more clear
This commit is contained in:
parent
2207d836f1
commit
906c7eb7ec
4 changed files with 19 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="NBXplorer.Client" Version="4.0.0" />
|
<PackageReference Include="NBXplorer.Client" Version="4.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Condition="'$(Altcoins)' != 'true'">
|
<ItemGroup Condition="'$(Altcoins)' != 'true'">
|
||||||
<Compile Remove="Altcoins\**\*.cs"></Compile>
|
<Compile Remove="Altcoins\**\*.cs"></Compile>
|
||||||
|
|
|
@ -489,7 +489,12 @@ namespace BTCPayServer.Controllers
|
||||||
.ToArray();
|
.ToArray();
|
||||||
var balance = _walletProvider.GetWallet(network).GetBalance(paymentMethod.AccountDerivation);
|
var balance = _walletProvider.GetWallet(network).GetBalance(paymentMethod.AccountDerivation);
|
||||||
model.NBXSeedAvailable = await GetSeed(walletId, network) != null;
|
model.NBXSeedAvailable = await GetSeed(walletId, network) != null;
|
||||||
model.CurrentBalance = (await balance).Total.GetValue(network);
|
var Balance= await balance;
|
||||||
|
model.CurrentBalance = (Balance.Available ?? Balance.Total).GetValue(network);
|
||||||
|
if (Balance.Immature is null)
|
||||||
|
model.ImmatureBalance = 0;
|
||||||
|
else
|
||||||
|
model.ImmatureBalance = Balance.Immature.GetValue(network);
|
||||||
|
|
||||||
await Task.WhenAll(recommendedFees);
|
await Task.WhenAll(recommendedFees);
|
||||||
model.RecommendedSatoshiPerByte =
|
model.RecommendedSatoshiPerByte =
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||||
public bool SubtractFeesFromOutput { get; set; }
|
public bool SubtractFeesFromOutput { get; set; }
|
||||||
}
|
}
|
||||||
public decimal CurrentBalance { get; set; }
|
public decimal CurrentBalance { get; set; }
|
||||||
|
public decimal ImmatureBalance { get; set; }
|
||||||
|
|
||||||
public string CryptoCode { get; set; }
|
public string CryptoCode { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
<input type="hidden" asp-for="Fiat" />
|
<input type="hidden" asp-for="Fiat" />
|
||||||
<input type="hidden" asp-for="Rate" />
|
<input type="hidden" asp-for="Rate" />
|
||||||
<input type="hidden" asp-for="CurrentBalance" />
|
<input type="hidden" asp-for="CurrentBalance" />
|
||||||
|
<input type="hidden" asp-for="ImmatureBalance" />
|
||||||
<input type="hidden" asp-for="CryptoCode" />
|
<input type="hidden" asp-for="CryptoCode" />
|
||||||
<input type="hidden" name="BIP21" id="BIP21" />
|
<input type="hidden" name="BIP21" id="BIP21" />
|
||||||
|
|
||||||
|
@ -79,8 +80,12 @@
|
||||||
</div>
|
</div>
|
||||||
<span asp-validation-for="Outputs[0].Amount" class="text-danger"></span>
|
<span asp-validation-for="Outputs[0].Amount" class="text-danger"></span>
|
||||||
<p class="form-text text-secondary crypto-info">
|
<p class="form-text text-secondary crypto-info">
|
||||||
Your current balance is
|
Your available balance is
|
||||||
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
|
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
|
||||||
|
@if (Model.ImmatureBalance>0)
|
||||||
|
{
|
||||||
|
<span><br>Note: @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.</span>
|
||||||
|
}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -109,6 +114,10 @@
|
||||||
<p class="form-text text-secondary crypto-info mb-2">
|
<p class="form-text text-secondary crypto-info mb-2">
|
||||||
Your current balance is
|
Your current balance is
|
||||||
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
|
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
|
||||||
|
@if (Model.ImmatureBalance > 0)
|
||||||
|
{
|
||||||
|
<span><br>Note: @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.</span>
|
||||||
|
}
|
||||||
</p>
|
</p>
|
||||||
<span asp-validation-for="Outputs[index].Amount" class="text-danger"></span>
|
<span asp-validation-for="Outputs[index].Amount" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue