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

# Prepare Swaps and Batches

Use the built-in helpers when your app needs more than one simple transfer.

## Jupiter swaps

<CodeGroup dropdown>
  ```typescript TypeScript theme={null}
  const preparedSwap = await wallet.swap.jupiter({
    feePayer,
    inputMint,
    outputMint,
    amount: 10_000n,
    slippageBps: 100,
    destinationAccount,
    wrapAndUnwrapSol: true,
  });
  ```

  ```python Python theme={null}
  prepared_swap = await wallet.swap.jupiter(
      fee_payer=fee_payer,
      input_mint=input_mint,
      output_mint=output_mint,
      amount=10_000,
      slippage_bps=100,
      destination_account=destination_account,
      wrap_and_unwrap_sol=True,
  )
  ```
</CodeGroup>

`destinationAccount` is the recipient owner. The backend resolves the output
ATA for SPL outputs or the native destination for unwrapped SOL.

## Grouped operations

Use `wallet.prepare(...)` when you want the backend to shape a batch instead of
calling single-operation helpers one by one. Both SDKs send this request to
`POST /transaction/prepare/batch`.

<CodeGroup dropdown>
  ```typescript TypeScript theme={null}
  const prepared = await wallet.prepare({
    feePayer,
    operations: [
      {
        type: 'transferSol',
        destination,
        amount: 1_000_000n,
      },
      {
        type: 'transferToken',
        mint,
        destinationOwner,
        amount: 10_000n,
      },
    ],
  });
  ```

  ```python Python theme={null}
  from swig_developer_sdk import TransferSolOperation, TransferTokenOperation

  prepared = await wallet.prepare(
      fee_payer=fee_payer,
      operations=(
          TransferSolOperation(
              destination=destination,
              amount=1_000_000,
          ),
          TransferTokenOperation(
              mint=mint,
              destination_owner=destination_owner,
              amount=10_000,
          ),
      ),
  )
  ```
</CodeGroup>

## When to use this page

Use swaps when the action is explicitly a Jupiter route.

Use grouped operations when:

* you want the backend to return one ordered plan
* your app already knows several actions should happen together
* you want one preparation response instead of several separate ones
