> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rhinestone.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a transaction

> Send single-chain and cross-chain transactions from a Rhinestone smart account.

## Send a single-chain transaction

Call `sendTransaction` with a `chain` and a list of `calls`. The example below transfers USDC on Base Sepolia:

```ts theme={null}
import { encodeFunctionData, erc20Abi } from 'viem'
import { baseSepolia } from 'viem/chains'

const receiver = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
const usdcAmount = 1n

const transaction = await rhinestoneAccount.sendTransaction({
  chain: baseSepolia,
  calls: [
    {
      to: 'USDC',
      value: 0n,
      data: encodeFunctionData({
        abi: erc20Abi,
        functionName: 'transfer',
        args: [receiver, usdcAmount],
      }),
    },
  ],
})

const result = await rhinestoneAccount.waitForExecution(transaction)
console.log('Result', result)
```

## Send a cross-chain transaction

Swap `chain` for `sourceChains` + `targetChain`. The SDK handles bridging and routing with no separate bridge interaction required:

```ts theme={null}
import { baseSepolia, arbitrumSepolia } from 'viem/chains'

const transaction = await rhinestoneAccount.sendTransaction({
  sourceChains: [baseSepolia],
  targetChain: arbitrumSepolia,
  calls: [
    {
      to: 'USDC',
      value: 0n,
      data: encodeFunctionData({
        abi: erc20Abi,
        functionName: 'transfer',
        args: [receiver, usdcAmount],
      }),
    },
  ],
  tokenRequests: [
    {
      address: 'USDC',
      amount: usdcAmount,
    },
  ],
})

const result = await rhinestoneAccount.waitForExecution(transaction)
```

## Use the granular API

Use `prepareTransaction` → `signTransaction` → `submitTransaction` when you need to separate fetching from signing. For example, to show the user transaction details before they approve, or to fetch intent data on a backend and sign on a mobile frontend:

```ts theme={null}
// Fetch intent data (can be done server-side)
const transactionData = await rhinestoneAccount.prepareTransaction({
  chain: baseSepolia,
  calls: [...],
})

// Sign: prompts account owners
const signedData = await rhinestoneAccount.signTransaction(transactionData)

// Submit
const transaction = await rhinestoneAccount.submitTransaction(signedData)
```

<Note>To deploy the account on a specific chain before transacting, call `await rhinestoneAccount.deploy(chain)` first.</Note>

<Note>Any `sendTransaction` call triggers deployment if the account is not yet deployed on that chain. It does not have to be a token transfer. Contract calls, approvals, or any other action will deploy the account as part of the intent.</Note>

## Next steps

<CardGroup cols={3}>
  <Card title="Crosschain" icon="arrow-right-left" href="../chain-abstraction/multi-chain-intent">
    Send funds across chains with a single signature. No bridging required.
  </Card>

  <Card title="Unified balance" icon="wallet" href="../chain-abstraction/unified-balance">
    Aggregate user balances across chains to fund any intent.
  </Card>

  <Card title="Sponsor fees" icon="fuel" href="../tutorials/sponsor-fees">
    Cover gas, bridging, and swap fees for your users.
  </Card>
</CardGroup>
