Blocto
About porttoBlog
  • 📣Introduction
  • Blocto Environment
  • Give Feedback
  • BLOCTO SDK
    • Overview
    • JavaScript SDK
      • Flow
        • Tutorial
        • Configure FCL
        • Authenticate / Unauthenticate
        • Send Transaction
        • Account Proof
        • Flow Networks
        • Verified Transaction
        • Migration Guide
  • Blocto App
    • Deep Linking
    • Token Listing
    • NFT Listing (on Flow)
  • Technical Documents
    • Key Management
  • BloctoSwap
    • Token Listing
  • Support
    • Contact Us
    • Web Wallet v1 Sunset Notice and Migration Guide
  • Community
    • Discord
    • Twitter
    • Facebook
Powered by GitBook
On this page
  • Step 1 - Send transaction
  • Step 2 - Authorizing a transaction

Was this helpful?

  1. BLOCTO SDK
  2. JavaScript SDK
  3. Flow

Send Transaction

Send Transaction with Blocto wallet through Flow Client Library (FCL)

Before sending a transaction, user needs to connect to Blocto wallet first.

Step 1 - Send transaction

import * as fcl from "@blocto/fcl";

const SIMPLE_TRANSACTION = `\
transaction {
  execute {
    log("Hello World!!")
  }
}
`;


const transactionId = await fcl.mutate({
  cadence: SIMPLE_TRANSACTION,
  proposer: fcl.currentUser,
  payer: fcl.currentUser,
  limit: 50,
});

// The transactions status and events after being sealed
const transaction = await fcl.tx(transactionId).onceSealed();

Step 2 - Authorizing a transaction

import * as fcl from "@blocto/fcl";

const transactionId = await fcl.mutate({
  cadence: `
    transaction {
      prepare(acct: AuthAccount) {
        log("Hello from prepare")
      }
      execute {
        log("Hello from execute")
      }
    }
  `,
  proposer: fcl.currentUser,
  payer: fcl.currentUser,
  authorizations: [fcl.currentUser],
  limit: 50,
});

const transaction = await fcl.tx(transactionId).onceSealed();
console.log(transaction); // The transactions status and events after being sealed
PreviousAuthenticate / UnauthenticateNextAccount Proof

Last updated 23 days ago

Was this helpful?