Before sending a transaction, user needs to connect to Blocto wallet first.
import * as fcl from "@onflow/fcl"const SIMPLE_TRANSACTION = `\transaction {execute {log("Hello World!!")}}`// Get latest block infoconst blockResponse = await fcl.send([fcl.getLatestBlock(),])// Decode block infoconst block = await fcl.decode(blockResponse)// Send transactionconst tx = await fcl.send([fcl.transaction(SIMPLE_TRANSACTION),fcl.proposer(fcl.currentUser().authorization),fcl.payer(fcl.currentUser().authorization),fcl.ref(block.id),])
import * as fcl from "@onflow/fcl"// Monitor transaction resultfcl.tx(tx).subscribe(console.log) // fires everytime tx status updates