> ## 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 transactions

> Send a single transaction from the user's smart account.

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 in each context, see [Who pays for gas](/concepts/gasless).

## Send native value

```tsx theme={null}
import { useSendTransaction } from 'wagmi'
import { parseEther } from 'viem'

const { sendTransactionAsync } = useSendTransaction()

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

## Call a contract

```tsx theme={null}
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

```ts theme={null}
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, `eth_sendTransaction` is gasless for the user. What happens:

1. **Context detection.** When your page runs inside an iframe, the App SDK uses the Mini App wallet provider, so the request goes to the Startale App host instead of opening a popup.

2. **Conversion to a UserOperation.** The host converts the request into an ERC-4337 UserOperation sent from the user's smart account.

3. **Sponsorship.** The host attaches its own paymaster. Nothing in your code selects it and nothing in the request carries it. Sponsorship is decided by the host, not by the Mini App.

4. **Submission.** The host submits the UserOperation to a bundler, which calls `handleOps` on the EntryPoint contract. Gas is settled by Startale rather than by the user.

**As a Mini App developer you configure nothing.** There is no paymaster URL and no `paymasterOptions` in your code. See [Gas](/miniapps/wallet-integration#gas) for the caps that apply and how to handle them.

## Gas in a standalone application

Outside the Startale App, gas is not sponsored. You configure a paymaster or the user pays. See [Gas in a standalone application](/app-sdk/gasless).

<Warning>
  `eth_sendTransaction` cannot carry a custom paymaster. `paymasterOptions` is delivered as an EIP-5792 capability, and capabilities travel only on `wallet_sendCalls`. If you configure a paymaster and then send through `eth_sendTransaction`, the transaction succeeds and the **user** pays, with no error indicating the paymaster was skipped. Use [batched calls](/app-sdk/batched-calls) instead, even for a single call.
</Warning>

For batched calls or atomic multi-step transactions, see [Batched calls](/app-sdk/batched-calls).

## Errors

| Code | Meaning |
| - | - |
| `4001` | User rejected the transaction in the popup |
| `4100` | Wallet not connected |
| `4900` | Provider disconnected |

See [Errors](/app-sdk/errors) for the full list.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.