Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/pages/exchange_view/exchange_step_views/step_4_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,14 @@ class _Step4ViewState extends ConsumerState<Step4View> {
);

if (wallet is FiroWallet && !firoPublicSend) {
throw Exception(
"Sending private Firo funds to an exchange address is temporarily "
"unavailable.",
txDataFuture = wallet.prepareSendSpark(
txData: TxData(
recipients: [recipient],
note:
"${model.trade!.payInCurrency.toUpperCase()}/"
"${model.trade!.payOutCurrency.toUpperCase()} exchange",
),
requireChaumV2: true,
);
} else {
final memo = wallet.info.coin is Stellar
Expand Down
19 changes: 16 additions & 3 deletions lib/pages/exchange_view/send_from_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
),
);
} else {
final firoWallet = wallet as FiroWallet;
// otherwise do firo send based on balance selected
if (shouldSendPublicFiroFunds) {
txDataFuture = wallet.prepareSend(
Expand All @@ -302,9 +303,21 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
),
);
} else {
throw Exception(
"Sending private Firo funds to an exchange address is "
"temporarily unavailable.",
txDataFuture = firoWallet.prepareSendSpark(
txData: TxData(
recipients: recipient.addressType == .spark ? null : [recipient],
sparkRecipients: recipient.addressType == .spark
? [
(
address: recipient.address,
amount: recipient.amount,
memo: "",
isChange: false,
),
]
: null,
),
requireChaumV2: true,
);
}
}
Expand Down
11 changes: 9 additions & 2 deletions lib/wallets/wallet/impl/firo_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ class MasternodeInfo {

final kMasterNodeValue = Decimal.fromInt(1000); // full value (not sats)

const _zeroTxid =
"0000000000000000000000000000000000000000000000000000000000000000";

class FiroWallet<T extends ElectrumXCurrencyInterface> extends Bip39HDWallet<T>
with
ElectrumXInterface<T>,
Expand Down Expand Up @@ -278,7 +281,10 @@ class FiroWallet<T extends ElectrumXCurrencyInterface> extends Bip39HDWallet<T>

final txid = map["txid"] as String?;
final vout = map["vout"] as int?;
if (coinbase == null && txid != null && vout != null) {
if (coinbase == null &&
txid != null &&
vout != null &&
txid != _zeroTxid) {
txInputTxidsSet.add(txid);
}
}
Expand Down Expand Up @@ -992,7 +998,8 @@ class FiroWallet<T extends ElectrumXCurrencyInterface> extends Bip39HDWallet<T>
).raw.toInt();
if (collateralUtxo.value != expectedCollateralRaw) {
throw Exception(
"Collateral outpoint must be exactly ${kMasterNodeValue.toString()} FIRO.",
"Collateral outpoint must be exactly "
"${kMasterNodeValue.toString()} FIRO.",
);
}

Expand Down
Loading
Loading