Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.startale.com/llms.txt

Use this file to discover all available pages before exploring further.

Send a transaction the same way you would with any wagmi-compatible wallet. The user’s smart account is the sender. For details on who pays gas and how to configure sponsorship, see Gas sponsorship.

Send native value

import { useSendTransaction } from 'wagmi'
import { parseEther } from 'viem'

const { sendTransactionAsync } = useSendTransaction()

const hash = await sendTransactionAsync({
  to: '0x000000000000000000000000000000000000dEaD',
  value: parseEther('0.001'),
})

Call a contract

import { useWriteContract } from 'wagmi'
import { erc20Abi } from 'viem'

const { writeContractAsync } = useWriteContract()

const hash = await writeContractAsync({
  address: USDSC_ADDRESS,
  abi: erc20Abi,
  functionName: 'transfer',
  args: [recipient, amount],
})

With the raw provider

const hash = await provider.request({
  method: 'eth_sendTransaction',
  params: [
    {
      to: '0x000000000000000000000000000000000000dEaD',
      value: '0x38d7ea4c68000', // 0.001 ETH in wei
    },
  ],
})
The from field is set automatically to the user’s smart account. If you supply a from value, it is ignored.

How gas works in Mini Apps

When your Mini App runs inside the Startale App, every eth_sendTransaction call is gasless for the user. Here is exactly what happens under the hood:
  1. Context detection. The App SDK detects it is running inside the Startale App iframe and automatically routes requests through the host wallet instead of opening a standalone popup.
  2. Conversion to a UserOperation. The SDK converts the eth_sendTransaction call into an ERC-4337 UserOperation using the AA SDK. This is what allows the transaction to carry a paymaster signature.
  3. Paymaster capability injection. Before the request reaches the wallet, the SDK automatically injects an EIP-5792 paymasterService capability into the wallet_sendCalls payload:
    capabilities: {
      paymasterService: {
        url: "<SCS_PAYMASTER_URL>",
        id: "<HOST_PAYMASTER_ID>",
      }
    }
    
    This happens in the SDK’s request interceptor — your code does not need to pass any paymaster configuration.
  4. AA SDK builds and signs the UserOperation. The Startale App’s backend uses createSCSPaymasterClient from the AA SDK to fetch a paymaster signature for the UserOperation. The paymaster co-signs the UserOp, committing to cover the gas cost.
  5. Bundler submission. The signed UserOperation is submitted to the SCS Bundler, which packages it and calls handleOps on the EntryPoint contract. Gas is paid by the Startale paymaster, not the user.
As a Mini App developer, you do not configure anything. There is no paymasterOptions, no paymaster URL, and no paymasterId in your code. The Startale App host owns the paymaster and injects it transparently. For standalone dApps outside the Startale App, gas sponsorship requires explicit configuration. See Gas sponsorship for the full breakdown and the paymasterOptions reference. For batched calls or atomic multi-step transactions, see Batched calls.

Errors

CodeMeaning
4001User rejected the transaction in the popup
4100Wallet not connected
4900Provider disconnected
See Errors for the full list.