Transaction Broadcast

When a PSET has enough signatures, it's ready to be broadcasted to the Liquid Network.

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);
pset = wollet.finalize(pset)
const tx = pset.extractTx();
const txid = await client.broadcastTx(tx)

// (optional)
wollet.applyTransaction(tx);
	tx, err := pset.Finalize()
	if err != nil {
		log.Fatal(err)
	}
	txid, err = client.Broadcast(tx)
	if err != nil {
		log.Fatal(err)
	}

	// optional
	if err := wollet.ApplyTransaction(tx); err != nil {
		log.Fatal(err)
	}

Next: Advanced Features


Did this page help you?

The Liquid Network is a Bitcoin layer-2 enabling the issuance of security tokens and other digital assets.

© 2023 Liquid Network
All rights reserved.

Feedback and Content Requests

We'd be happy to hear your suggestions on how we can improve this site.

BuildOnL2 Community

The official BuildOnL2 community lives
at community.liquid.net. Join us and build the future of Bitcoin on Liquid.

Telegram

Community-driven telegram group where
most of the Liquid developers hang out.
Go to t.me/liquid_devel to join.