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

# スワップ・トランザクション生成（基本入力）

> 固定入力額のシリアライズされたスワップ・トランザクションを生成します。
`/compute/swap-base-in` からの成功したcompute レスポンスが必要です。




## OpenAPI

````yaml /ja/api-reference/openapi/route-api-v2.yaml post /transaction/swap-base-in
openapi: 3.0.3
info:
  title: Raydium トランザクション API (Route V2)
  version: 1.0.0
  description: >
    Solana のサーバーサイド・スワップ・トランザクション・ビルダー。このAPI は、クライアントが RPC コネクションまたはフル Raydium
    SDK を実行することなく、シリアライズされたスワップ・トランザクションを生成します。


    レスポンスは標準的なエンベロープ形式に従います：

    - **成功**: `{ id: string, success: true, data: {...} }`

    - **エラー**: `{ id: string, success: false, msg: string }`
  contact:
    name: Raydium
    url: https://raydium.io
servers:
  - url: https://transaction-v1.raydium.io
    description: Mainnet
  - url: https://transaction-v1-devnet.raydium.io
    description: Devnet
security: []
tags:
  - name: Compute
    description: スワップ・クオート計算用の読み取り専用エンドポイント（トランザクション・ビルディングなし）。
  - name: Transaction
    description: 署名・ブロードキャスト可能なシリアライズされたスワップ・トランザクションを生成します。
paths:
  /transaction/swap-base-in:
    post:
      tags:
        - Transaction
      summary: スワップ・トランザクション生成（基本入力）
      description: |
        固定入力額のシリアライズされたスワップ・トランザクションを生成します。
        `/compute/swap-base-in` からの成功したcompute レスポンスが必要です。
      operationId: buildSwapTransactionBaseIn
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildTransactionRequest'
      responses:
        '200':
          description: シリアライズされたトランザクションが正常に生成されました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        '400':
          description: 無効なリクエスト・ボディまたはcompute状態です。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BuildTransactionRequest:
      type: object
      required:
        - wallet
        - swapResponse
        - txVersion
        - computeUnitPriceMicroLamports
      properties:
        wallet:
          type: string
          description: 署名者ウォレットアドレス（base58形式）です。
          example: '11111111111111111111111111111111'
        swapResponse:
          type: object
          description: コンピュートエンドポイントからの完全なレスポンスオブジェクトです。
          properties:
            id:
              type: string
            success:
              type: boolean
            version:
              type: string
            data:
              type: object
        txVersion:
          type: string
          enum:
            - V0
            - LEGACY
          description: Solanaトランザクションのバージョンです。
          example: V0
        computeUnitPriceMicroLamports:
          type: string
          description: マイクロラムポート単位のコンピュートユニット価格（優先フィー用）です。
          example: '1000'
        wrapSol:
          type: boolean
          description: 入力がネイティブSOLの場合、SOLをラップするかどうかです。
          example: false
        unwrapSol:
          type: boolean
          description: 出力でWSolをSOLにアンラップするかどうかです。
          example: false
        inputAccount:
          type: string
          description: 入力用のオプショナルトークンアカウントアドレスです。SOLをラップしない場合は必須です。
          example: TokenAccount1111111111111111111111111111111111
        outputAccount:
          type: string
          description: 出力用のオプショナルトークンアカウントアドレスです。
          example: TokenAccount2222222222222222222222222222222222
        jitoInfo:
          type: object
          description: MEV対策用のオプショナルJitoバンドルパラメータです。
          properties:
            address:
              type: string
              description: Jitoバンドル送信アドレスです。
            amount:
              type: string
              description: ラムポート単位のバンドルチップ額です。
        referrerWallet:
          type: string
          description: フィー回収用のオプショナルリファラーウォレットアドレスです。
          example: ReferrerWallet1111111111111111111111111111111111
    TransactionResponse:
      type: object
      properties:
        id:
          type: string
          description: 一意のリクエスト識別子。
          example: 550e8400-e29b-41d4-a716-446655440000
        success:
          type: boolean
          description: トランザクション構築が成功したかどうかです。
          example: true
        version:
          type: string
          example: V1
        data:
          type: object
          description: トランザクションデータです。
          properties:
            transaction:
              type: string
              description: 署名可能な状態のBase64エンコード済みバージョン付きトランザクションです。
            addressLookupTableAddresses:
              type: array
              description: アドレスルックアップテーブルのアドレス（txVersion=V0の場合）です。
              items:
                type: string
    ErrorResponse:
      type: object
      properties:
        id:
          type: string
          description: 一意のリクエスト識別子です。
        success:
          type: boolean
          example: false
        version:
          type: string
          example: V1
        msg:
          type: string
          description: エラーメッセージコード（例：REQ_SLIPPAGE_BPS_ERROR、REQ_WALLET_ERROR）です。

````