Broadcasting
Learn how to broadcast transactions to the Stacks network.
Broadcasting Transactions
A finalized transaction can be broadcasted to the network or serialized (to a byte representation) using Stacks.js.
1import { broadcastTransaction, makeSTXTokenTransfer } from "@stacks/transactions";23const transaction = await makeSTXTokenTransfer({4recipient: "ST1SJ3DTE5DN7X54YDH5D64R3BCB6A2AG2ZQ8YPD5",5amount: 42000000,6senderKey:7"753b7cc01a1a2e86221266a154af739463fce51219d97e4f856cd7200c3bd2a601",8network: "devnet",9});1011const tx = await broadcastTransaction({ transaction });12
Info
For web applications, user wallets can broadcast transactions via @stacks/connect.