createSendTx method
Implementation
SendTx createSendTx({
required Address toAddress,
required BigInt amountRaw,
required List<Utxo> spendableUtxos,
required BigInt feePerInput,
String? note,
}) {
final txBuilder = TransactionBuilder(utxos: spendableUtxos);
final selectedUtxos = txBuilder.selectUtxos(
spendAmount: amountRaw,
feePerInput: feePerInput,
);
final fee = BigInt.from(selectedUtxos.length) * feePerInput;
return SendTx(
uri: KaspaUri(
address: toAddress,
amount: Amount.raw(amountRaw),
),
amountRaw: amountRaw,
utxos: selectedUtxos,
fee: fee,
note: note,
);
}