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

# prepareTransaction

> Prepare an intent transaction for signing.

On an account with a managed Solana entry, `{ destination: { chain, authority } }` adds or
removes a passkey or ECDSA key on its Swig (see `addPasskey` and
`addEcdsaKey`). That change is always gas-sponsored and billed to the
integrator's sponsorship; do not add a `sponsored` flag to authority inputs.

The execution example requires a managed EVM account, a viem `base` chain,
destination `calls`, and sponsorship enabled for your integrator. The
delivery example requires sufficient USDC in the account on `base` to
cover delivery and fees; `usdcOnBase` and `usdcOnOptimism` are token addresses,
`optimism` is the viem destination chain, and `recipient` is the destination
EVM address. Amounts use the token's smallest units: `1_000_000n` is
1 USDC for a six-decimal token.

Method on an account instance returned by [`createAccount`](/wallets/custom-signer/sdk-reference/rhinestone-sdk/create-account). Requires a managed transaction account (EVM or managed Solana); unavailable on receiver-only and standalone Solana accounts.

## Usage

```ts theme={null}
const prepared = await account.prepareTransaction({
  destination: { chain: base, calls },
  sponsored: true,
})
```

```ts theme={null}
const delivery = await account.prepareTransaction({
  source: { chain: base, token: usdcOnBase },
  destination: {
    chain: optimism,
    token: usdcOnOptimism,
    amount: 1_000_000n,
    recipient,
  },
})
```

## Parameters

<ParamField path="transaction" type="AccountTransaction<_C>" required>
  Transaction to prepare
</ParamField>

## Returns

<ResponseField name="transaction" type="PreparedTransactionData">
  The prepared transaction data, including available quotes
</ResponseField>

## See also

* [signTransaction](/wallets/custom-signer/sdk-reference/account/transactions/sign-transaction) to sign the prepared transaction
* [submitTransaction](/wallets/custom-signer/sdk-reference/account/transactions/submit-transaction) to submit the signed transaction


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