Connect 4337
Cometh ConnectCometh MarketplaceCometh Checkout
  • 🚀Quick start
    • What is Connect 4337
    • Getting started
    • Supported Networks
  • 🛠️CORE FEATURES
    • Create a Wallet
    • Send transactions
    • Go Gasless
    • Sign/Verify a message
    • Retrieve a wallet address
    • Handle owners
    • Import a safe into connect
  • 🥷ADVANCED
    • Session Keys
      • Tutorial
      • Policies
        • Sudo policy
        • Action policy
    • Social recovery
    • Add a passkey signer on a different OS
    • Capabilities
      • sendCalls
      • getCallsStatus
      • getCapabilities
      • grantPermissions
    • Other signers (Auth Providers)
      • EOA wallets (Metamask, Phantom...)
      • Magic signer
      • Web3Auth signer
      • Turnkey signer
      • Privy signer
  • 🔌Integrations
    • React hooks
      • ConnectProvider
      • useAccount
      • useConnect
      • useDisconnect
      • useGetGasPrice
      • useSendTransaction
      • useSignMessage
      • useVerifyMessage
      • useWriteContract
      • Handle owners
        • useRemoveOwner
        • useValidateAddDevice
        • useCreateNewSigner
        • useAddOwner
        • useGetOwners/EnrichedOwners
      • Session Keys
        • useGrantPermission
        • useSendPermission
        • useSessionKeyClient
        • useSessionKeySigner
      • Recovery
        • useIsRecoveryActive
        • useSetUpRecovery
        • useGetRecoveryRequest
        • useCancelRecoveryRequest
    • Mobile SDKs
      • IOS
      • Android
      • React Native
    • Wagmi
  • SDK Core
    • Signers (Auth Providers)
      • EOA wallets (Metamask, Phantom...)
      • Magic signer
      • Web3Auth signer
      • Turnkey signer
      • Privy signer
    • Handle owners
    • Capabilities
      • sendCalls
      • getCallsStatus
      • getCapabilities
  • SDK Session Keys
    • Setup Smart Account Client
    • Manage session keys
    • Policies
      • Sudo policy
      • Action policy
  • 📦Bundler
    • Bundler API
      • eth_sendUserOperation
      • eth_estimateUserOperationGas
      • eth_getUserOperationByHash
      • eth_getUserOperationReceipt
      • eth_supportedEntryPoints
  • 💳Paymaster
    • Paymaster API
  • 📖RESOURCES
    • Migrate from the connect legacy SDK
    • Connect Legacy SDKs (Unity, JS)
    • FAQ
Powered by GitBook
On this page
  • Send a single transaction
  • Send transactions batches
  1. CORE FEATURES

Send transactions

Sending user operations has never been easier

PreviousCreate a WalletNextGo Gasless

Last updated 4 months ago

Considering that the authentication part is done, you can start to send transactions. You'll just need to create the transaction and send it to the SDK.

Depending on the UX you want to provide, there are different ways of sending transactions.

For non sponsored transactions, each wallet will have to pay a prefund to the Entrypoint contract or be filled with native tokens.

To enable sponsored transactions, see the .

Send a single transaction

import { encodeFunctionData } from "viem";
import countContractAbi from "@/contract/counterABI.json";

const COUNTER_CONTRACT_ADDRESS = "0x4FbF9EE4B2AF774D4617eAb027ac2901a41a7b5F";

const calldata = encodeFunctionData({
  abi: countContractAbi,
  functionName: "count",
});

const txHash =  await smartAccountClient.sendTransaction(
  {
    to: COUNTER_CONTRACT_ADDRESS,
    data: calldata,
  }
);

Send transactions batches

With Cometh Connect, you can execute multiple actions in the same transaction.

import { encodeFunctionData } from "viem";
import countContractAbi from "@/contract/counterABI.json";

const COUNTER_CONTRACT_ADDRESS = "0x4FbF9EE4B2AF774D4617eAb027ac2901a41a7b5F";

const txHash =  await smartAccountClient.sendTransactions(
      {
        calls: [
          {
            to: COUNTER_CONTRACT_ADDRESS,
            data: calldata,
          },
          {
            to: COUNTER_CONTRACT_ADDRESS,
            data: calldata,
          },
        ],
      }
    )

🛠️
following documentation