forked from WalletWasabi/WalletWasabi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimal Decoupling of SendViewModel and TransactionPreview
- Loading branch information
ichthus1604
committed
Apr 17, 2024
1 parent
c8b1231
commit e23b106
Showing
6 changed files
with
95 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Collections.Generic; | ||
using WalletWasabi.Blockchain.TransactionOutputs; | ||
using WalletWasabi.Fluent.ViewModels.Wallets.Send; | ||
using WalletWasabi.Wallets; | ||
|
||
namespace WalletWasabi.Fluent.Models.Transactions; | ||
|
||
public record SendParameters( | ||
Wallet Wallet, | ||
ICoinsView AvailableCoins, | ||
TransactionInfo? TransactionInfo = null) | ||
{ | ||
public static SendParameters Create(Wallet wallet) => new SendParameters(wallet, wallet.Coins); | ||
|
||
public static SendParameters CreateManual(Wallet wallet, IEnumerable<SmartCoin> coins) => new SendParameters(wallet, new CoinsView(coins)); | ||
|
||
public decimal AvailableAmountBtc => AvailableCoins.TotalAmount().ToDecimal(NBitcoin.MoneyUnit.BTC); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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