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

# بناء معاملة swap (إخراج أساسي)

> توليد معاملة swap مسلسلة لمبلغ إخراج مرغوب.
يتطلب رد ناجح من `/compute/swap-base-out`.




## OpenAPI

````yaml /ar/api-reference/openapi/route-api-v2.yaml post /transaction/swap-base-out
openapi: 3.0.3
info:
  title: واجهة معاملات Raydium (Route V2)
  version: 1.0.0
  description: >
    منشئ معاملات swap من جانب الخادم على Solana. تُنتج هذه الواجهة معاملات swap
    مسلسلة دون احتياج العملاء لتشغيل اتصال 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: بناء معاملات swap مسلسلة جاهزة للتوقيع والبث.
paths:
  /transaction/swap-base-out:
    post:
      tags:
        - Transaction
      summary: بناء معاملة swap (إخراج أساسي)
      description: |
        توليد معاملة swap مسلسلة لمبلغ إخراج مرغوب.
        يتطلب رد ناجح من `/compute/swap-base-out`.
      operationId: buildSwapTransactionBaseOut
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildTransactionRequest'
      responses:
        '200':
          description: تم بناء المعاملة المسلسلة بنجاح.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        '400':
          description: نص طلب غير صحيح أو حالة حساب غير صحيحة.
          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: معاملات حزمة Jito اختيارية لحماية MEV.
          properties:
            address:
              type: string
              description: عنوان تقديم حزمة Jito.
            amount:
              type: string
              description: مبلغ نصيحة الحزمة بالـ lamports.
        referrerWallet:
          type: string
          description: عنوان محفظة الحائل (referrer) اختياري لجمع الرسوم.
          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).'

````