mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-04-01 11:59:06 +00:00
fix monero and wownero sendall
This commit is contained in:
parent
c2f3c77d2f
commit
da941376be
2 changed files with 22 additions and 0 deletions
lib/services/coins
|
@ -1447,6 +1447,16 @@ class MoneroWallet extends CoinServiceAPI {
|
|||
|
||||
Future<PendingTransaction>? awaitPendingTransaction;
|
||||
try {
|
||||
// check for send all
|
||||
bool isSendAll = false;
|
||||
final balance = await availableBalance;
|
||||
final satInDecimal = ((Decimal.fromInt(satoshiAmount) /
|
||||
Decimal.fromInt(Constants.satsPerCoinWownero))
|
||||
.toDecimal() *
|
||||
Decimal.fromInt(10000));
|
||||
if (satInDecimal == balance) {
|
||||
isSendAll = true;
|
||||
}
|
||||
Logging.instance
|
||||
.log("$toAddress $amount $args", level: LogLevel.Info);
|
||||
String amountToSend = moneroAmountToString(amount: amount * 10000);
|
||||
|
@ -1454,6 +1464,7 @@ class MoneroWallet extends CoinServiceAPI {
|
|||
|
||||
monero_output.Output output = monero_output.Output(walletBase!);
|
||||
output.address = toAddress;
|
||||
output.sendAll = isSendAll;
|
||||
output.setCryptoAmount(amountToSend);
|
||||
|
||||
List<monero_output.Output> outputs = [output];
|
||||
|
|
|
@ -1453,6 +1453,16 @@ class WowneroWallet extends CoinServiceAPI {
|
|||
|
||||
Future<PendingTransaction>? awaitPendingTransaction;
|
||||
try {
|
||||
// check for send all
|
||||
bool isSendAll = false;
|
||||
final balance = await availableBalance;
|
||||
final satInDecimal = ((Decimal.fromInt(satoshiAmount) /
|
||||
Decimal.fromInt(Constants.satsPerCoinWownero))
|
||||
.toDecimal() *
|
||||
Decimal.fromInt(1000));
|
||||
if (satInDecimal == balance) {
|
||||
isSendAll = true;
|
||||
}
|
||||
Logging.instance
|
||||
.log("$toAddress $amount $args", level: LogLevel.Info);
|
||||
String amountToSend = wowneroAmountToString(amount: amount * 1000);
|
||||
|
@ -1460,6 +1470,7 @@ class WowneroWallet extends CoinServiceAPI {
|
|||
|
||||
wownero_output.Output output = wownero_output.Output(walletBase!);
|
||||
output.address = toAddress;
|
||||
output.sendAll = isSendAll;
|
||||
output.setCryptoAmount(amountToSend);
|
||||
|
||||
List<wownero_output.Output> outputs = [output];
|
||||
|
|
Loading…
Reference in a new issue