diff --git a/cw_monero/lib/api/structs/pending_transaction.dart b/cw_monero/lib/api/structs/pending_transaction.dart index db11c4f78..0934d0d19 100644 --- a/cw_monero/lib/api/structs/pending_transaction.dart +++ b/cw_monero/lib/api/structs/pending_transaction.dart @@ -4,11 +4,13 @@ class PendingTransactionDescription { required this.fee, required this.hash, required this.hex, - required this.pointerAddress}); + required this.pointerAddress, + required this.txCount}); final int amount; final int fee; final String hash; final String hex; final int pointerAddress; + final int txCount; } diff --git a/cw_monero/lib/api/transaction_history.dart b/cw_monero/lib/api/transaction_history.dart index 7c4ffc36e..dc8bc5273 100644 --- a/cw_monero/lib/api/transaction_history.dart +++ b/cw_monero/lib/api/transaction_history.dart @@ -219,6 +219,7 @@ Future createTransactionSync( fee: rFee, hash: rHash, hex: rHex, + txCount: pendingTx.txCount(), pointerAddress: pendingTx.ffiAddress(), ); } @@ -263,6 +264,7 @@ Future createTransactionMultDest( hash: tx.txid(''), hex: tx.hex(''), pointerAddress: tx.ffiAddress(), + txCount: tx.txCount(), ); } diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 2d932524a..fd86e82b2 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -491,7 +491,10 @@ abstract class MoneroWalletBase paymentId: ''); } - // final status = monero.PendingTransaction_status(pendingTransactionDescription); + if (pendingTransactionDescription.txCount != 1) { + throw MoneroTransactionCreationException( + "This payment would be split into ${pendingTransactionDescription.txCount} transactions. Send smaller transaction to yourself first.",); + } return PendingMoneroTransaction(pendingTransactionDescription, this); }