spark transaction to spark send fixes

This commit is contained in:
julian 2024-01-05 16:39:05 -06:00
parent 48ad3db84c
commit 42e18397d7

View file

@ -411,20 +411,6 @@ mixin SparkInterface on Bip39HDWallet, ElectrumXInterface {
} }
} }
tempInputs.add(
InputV2.isarCantDoRequiredInDefaultConstructor(
scriptSigHex: "d3",
sequence: 0xffffffff,
outpoint: null,
addresses: [],
valueStringSats: "0",
witness: null,
innerRedeemScriptAsm: null,
coinbase: null,
walletOwns: true,
),
);
final extractedTx = txb.buildIncomplete(); final extractedTx = txb.buildIncomplete();
extractedTx.addInput( extractedTx.addInput(
'0000000000000000000000000000000000000000000000000000000000000000' '0000000000000000000000000000000000000000000000000000000000000000'
@ -485,6 +471,24 @@ mixin SparkInterface on Bip39HDWallet, ElectrumXInterface {
rawValue: BigInt.from(spend.fee), rawValue: BigInt.from(spend.fee),
fractionDigits: cryptoCurrency.fractionDigits, fractionDigits: cryptoCurrency.fractionDigits,
); );
tempInputs.add(
InputV2.isarCantDoRequiredInDefaultConstructor(
scriptSigHex: "d3",
sequence: 0xffffffff,
outpoint: null,
addresses: [],
valueStringSats: tempOutputs
.map((e) => e.value)
.fold(fee.raw, (p, e) => p + e)
.toString(),
witness: null,
innerRedeemScriptAsm: null,
coinbase: null,
walletOwns: true,
),
);
return txData.copyWith( return txData.copyWith(
raw: rawTxHex, raw: rawTxHex,
vSize: extractedTx.virtualSize(), vSize: extractedTx.virtualSize(),