Transaction Broadcast
When a PSET has enough signatures, it's ready to be broadcasted to the Liquid Network.
Finalize the PSET
First you need to call Wollet::finalize()
to finalize the PSET and extract the signed transaction.
Broadcast the Transaction
The transaction returned by the previous step can be sent to the Liquid Network with EsploraClient::broadcast()
.
Apply the Transaction
If you send a transaction you might want to see the balance decrease immediately.
With LWK this does not happens automatically,
you can do a "full scan" and apply the returned update.
However this requires network calls and it might be slow,
if you want your balance to be updated immediately,
you can call Wollet::apply_tx()
.
let tx = wollet.finalize(&mut pset)?;
let txid = client.broadcast(&tx)?;
// (optional)
wollet.apply_transaction(tx)?;
pset = wollet.finalize(pset)
const tx = pset.extractTx();
const txid = await client.broadcastTx(tx)
// (optional)
wollet.applyTransaction(tx);
Next: Advanced Features