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

# Get Action

> Generates a transaction for cross-chain swaps, bridges, and calls. The action includes transaction data, routing information, and fee calculations for executing the requested operation.



## OpenAPI

````yaml /swap-api-reference/openapi.json get /getAction
openapi: 3.1.0
info:
  title: Swaps API
  description: >-
    The Swaps API provides instant cross-chain swap and bridge functionality for
    decentralized applications.

    It supports multiple virtual machines (EVM, Solana, Bitcoin) and various DEX
    protocols and bridge solutions.
  version: 3.0.0
  contact:
    name: Swaps.xyz
    url: https://swaps.xyz
servers:
  - url: https://api-v2.swaps.xyz/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /getAction:
    get:
      summary: Get Action
      description: >-
        Generates a transaction for cross-chain swaps, bridges, and calls. The
        action includes transaction data, routing information, and fee
        calculations for executing the requested operation.
      operationId: getAction
      parameters:
        - name: actionType
          in: query
          required: true
          description: Type of action to perform
          schema:
            $ref: '#/components/schemas/ActionType'
        - name: sender
          in: query
          required: true
          description: The address of the sender/user
          schema:
            $ref: '#/components/schemas/Address'
        - name: srcChainId
          in: query
          required: true
          description: Source chain ID
          schema:
            $ref: '#/components/schemas/ChainId'
        - name: srcToken
          in: query
          required: true
          description: Source token address
          schema:
            $ref: '#/components/schemas/Address'
        - name: dstChainId
          in: query
          required: true
          description: Destination chain ID
          schema:
            $ref: '#/components/schemas/ChainId'
        - name: dstToken
          in: query
          required: true
          description: Destination token address
          schema:
            $ref: '#/components/schemas/Address'
        - name: slippage
          in: query
          required: true
          description: Slippage tolerance in bps
          schema:
            type: number
            format: float
            minimum: 0
            maximum: 10000
        - name: amount
          in: query
          required: false
          description: |-
            The exact in or exact out amount of the swap

            **Required:** for `swap-action`

            **Required:** for `polymarket` action type
          schema:
            type: string
            pattern: ^[0-9]$
        - name: swapDirection
          in: query
          required: false
          description: |-
            Swap direction for the action

            **Required:** for `swap-action`

            **Required:** for `polymarket` action type (use `exact-amount-in`)
          schema:
            $ref: '#/components/schemas/SwapDirection'
        - name: recipient
          in: query
          required: false
          description: >-
            Address to receive the swapped tokens


            **Optional:** for `swap-action`


            **Required:** for `polymarket` action type (should be the proxy
            wallet address)
          schema:
            $ref: '#/components/schemas/Address'
        - name: to
          in: query
          required: false
          description: |-
            The EVM address of the target contract (20 bytes hex)

            **Required:** for `evm-calldata-tx` action type
          schema:
            $ref: '#/components/schemas/Address'
        - name: data
          in: query
          required: false
          description: |-
            Calldata for the transaction

            **Required:** for `evm-calldata-tx` action type
          schema:
            $ref: '#/components/schemas/Hex'
        - name: value
          in: query
          required: false
          description: |-
            Value to send with transaction

            **Optional:** for `evm-calldata-tx` action type
          schema:
            type: string
            pattern: ^[0-9]$
        - name: erc20Amount
          in: query
          required: false
          description: >-
            The amount of Erc20 being transferred


            **Optional:** for `evm-calldata-tx` action type (use for calls
            requiring Erc20 transfers)
          schema:
            type: string
            pattern: ^[0-9]$
        - name: erc20Spender
          in: query
          required: false
          description: >-
            The Erc20 spender requiring approval for the transaction call


            **Optional:** for `evm-calldata-tx` action type (will default to the
            `to` address)
          schema:
            $ref: '#/components/schemas/Address'
        - name: solanaSponsor
          in: query
          required: false
          description: >-
            Solana address that pays for tx fees and rent (e.g. ATA creation).
            Only used for Solana same chain swaps. Transaction must be signed by
            both the user and the sponsor.


            **Optional:** When provided, the sponsor covers transaction costs on
            behalf of the user.
          schema:
            $ref: '#/components/schemas/Address'
        - name: bridgeIds
          in: query
          required: false
          description: |-
            Specific bridge protocols to use

            **Optional:** Will default to all available protocols
          schema:
            type: array
            items:
              $ref: '#/components/schemas/BridgeId'
        - name: refundTo
          in: query
          required: false
          description: |-
            Alternate address to receive refunds

            **Optional:** Will default to the `sender`
          schema:
            $ref: '#/components/schemas/Address'
        - name: returnDepositAddress
          in: query
          required: false
          description: >-
            Return a deposit address for deposit-based flows


            **Optional:** Set to `true` to receive a deposit address in the
            response
          schema:
            type: boolean
            default: false
        - name: appFees
          in: query
          required: false
          description: |-
            Application fees configuration as JSON array

            **Optional:** Will default to fees configured for the application

             **Example:** `[{ "bps": 50, "receiverAddress": "0x..." }]`
          schema:
            type: string
        - name: userId
          in: query
          required: false
          description: |-
            Polymarket user ID - returned from `POST /create`

            **Required:** for `polymarket` action type
          schema:
            type: string
        - name: side
          in: query
          required: false
          description: |-
            Order side for Polymarket orders

            **Required:** for `polymarket` action type
          schema:
            type: string
            enum:
              - BUY
              - SELL
        - name: tokenID
          in: query
          required: false
          description: |-
            Polymarket CLOB token ID

            **Required:** for `polymarket` action type
          schema:
            type: string
        - name: orderType
          in: query
          required: false
          description: |-
            Polymarket order type

            **Required:** for `polymarket` action type

            - `FOK`: Fill or Kill (market order)
            - `FAK`: Fill and Kill (market order)
          schema:
            type: string
            enum:
              - FOK
              - FAK
        - name: feeRateBps
          in: query
          required: false
          description: |-
            Fee rate in basis points (non-negative)

            **Required:** for `polymarket` action type
          schema:
            type: number
            minimum: 0
        - name: tickSize
          in: query
          required: false
          description: |-
            Price tick size for Polymarket orders

            **Required:** for `polymarket` action type
          schema:
            type: string
            enum:
              - '0.01'
              - '0.001'
              - '0.0001'
        - name: negRisk
          in: query
          required: false
          description: |-
            Negative risk flag for Polymarket

            **Required:** for `polymarket` action type
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
        - name: gasless
          in: query
          required: false
          description: >-
            Request gasless execution. When `true`, the response includes an
            `executions` array of signed steps to relay through the gasless
            provider instead of broadcasting a transaction directly.


            **Optional:** Only supported on chains with a configured gasless
            provider (currently Tron). Requires the API key to have gasless
            enabled.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful response with action data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
        '400':
          description: Bad request due to missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                AMOUNT_TOO_HIGH:
                  summary: Amount Too High
                  value:
                    success: false
                    error:
                      code: AMOUNT_TOO_HIGH
                      name: AmountTooHighError
                      message: The specified amount is too high.
                      title: Amount too high
                      statusCode: 400
                      details:
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstToken: '0x0000000000000000000000000000000000000000'
                        srcChainId: 1
                        dstChainId: 42161
                        maxAmount: 100000000000000000000
                      timestamp: '2024-01-01T00:00:00.000Z'
                AMOUNT_TOO_LOW:
                  summary: Amount Too Low
                  value:
                    success: false
                    error:
                      code: AMOUNT_TOO_LOW
                      name: AmountTooLowError
                      message: The specified amount is too low.
                      title: Amount too low
                      statusCode: 400
                      details:
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstToken: '0x0000000000000000000000000000000000000000'
                        srcChainId: 1
                        dstChainId: 42161
                        minAmount: 0.000123
                      timestamp: '2024-01-01T00:00:00.000Z'
                CROSS_VM_RECEIVER_REQUIRED:
                  summary: Cross VM Receiver Required
                  value:
                    success: false
                    error:
                      code: CROSS_VM_RECEIVER_REQUIRED
                      name: CrossVmReceiverRequiredError
                      message: >-
                        Receiver address is required for swaps across different
                        VMs.
                      title: Receiver address required
                      statusCode: 400
                      details:
                        srcChainId: 1
                        dstChainId: 1399811149
                      timestamp: '2024-01-01T00:00:00.000Z'
                EXCESSIVE_FEE:
                  summary: Excessive Fee
                  value:
                    success: false
                    error:
                      code: EXCESSIVE_FEE
                      name: ExcessiveFeeError
                      message: >-
                        The inputted flat fee is too large (over 50% of tx
                        input).
                      title: Excessive fee
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INSUFFICIENT_LIQUIDITY:
                  summary: Insufficient Liquidity
                  value:
                    success: false
                    error:
                      code: INSUFFICIENT_LIQUIDITY
                      name: InsufficientLiquidityError
                      message: >-
                        There is insufficient liquidity to complete this
                        transaction.
                      title: Insufficient liquidity
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_ADDRESS_FORMAT:
                  summary: Invalid Address Format
                  value:
                    success: false
                    error:
                      code: INVALID_ADDRESS_FORMAT
                      name: InvalidAddressError
                      message: The format of the specified address is invalid.
                      title: Invalid address format
                      statusCode: 400
                      details:
                        field: sender
                        address: 0xinvalid
                        reason: Address must be 40 characters long
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_AMOUNT_ZERO:
                  summary: Invalid Amount Zero
                  value:
                    success: false
                    error:
                      code: INVALID_AMOUNT_ZERO
                      name: InvalidAmountZeroError
                      message: Amount must be greater than zero.
                      title: Zero amount not allowed
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_DESTINATION_TOKEN:
                  summary: Invalid Destination Token
                  value:
                    success: false
                    error:
                      code: INVALID_DESTINATION_TOKEN
                      name: InvalidDstTokenError
                      message: Destination token is required.
                      title: Invalid destination token
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_PARAMETER:
                  summary: Invalid Parameter
                  value:
                    success: false
                    error:
                      code: INVALID_PARAMETER
                      name: InvalidParameterError
                      message: The request contains an invalid parameter.
                      title: Invalid parameter
                      statusCode: 400
                      details:
                        parameter: slippage
                        value: '15000'
                        reason: Slippage must be between 0 and 10000 bps
                      timestamp: '2024-01-01T00:00:00.000Z'
                INVALID_SOURCE_TOKEN:
                  summary: Invalid Source Token
                  value:
                    success: false
                    error:
                      code: INVALID_SOURCE_TOKEN
                      name: InvalidSrcTokenError
                      message: Source token is required.
                      title: Invalid source token
                      statusCode: 400
                      timestamp: '2024-01-01T00:00:00.000Z'
                MISSING_REQUIRED_FIELD:
                  summary: Missing Required Field
                  value:
                    success: false
                    error:
                      code: MISSING_REQUIRED_FIELD
                      name: MissingRequiredFieldError
                      message: The request is missing a required field.
                      title: Missing required field
                      statusCode: 400
                      details:
                        field: srcToken
                        context: Source token address is required for swap actions
                      timestamp: '2024-01-01T00:00:00.000Z'
                NO_AVAILABLE_ROUTE:
                  summary: No Available Route
                  value:
                    success: false
                    error:
                      code: NO_AVAILABLE_ROUTE
                      name: NoAvailableRouteError
                      message: No route is available for the specified parameters.
                      title: No available route
                      statusCode: 400
                      details:
                        srcChainId: 1
                        dstChainId: 42161
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstToken: '0x1234567890123456789012345678901234567890'
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_NETWORK:
                  summary: Unsupported Network
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_NETWORK
                      name: UnsupportedNetworkError
                      message: The network with the specified chainId is not supported.
                      title: Unsupported network
                      statusCode: 400
                      details:
                        chainId: 999999
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_NETWORK_PAIR:
                  summary: Unsupported Network Pair
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_NETWORK_PAIR
                      name: UnsupportedNetworkPairError
                      message: Routing between the specified networks is not supported.
                      title: Unsupported network pair
                      statusCode: 400
                      details:
                        srcChainId: 1
                        dstChainId: 999999
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_NETWORK_TOKEN_PAIR:
                  summary: Unsupported Network Token Pair
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_NETWORK_TOKEN_PAIR
                      name: UnsupportedNetworkAndTokenPairError
                      message: >-
                        Routing between the specified tokens and networks is not
                        supported.
                      title: Unsupported network and token pair
                      statusCode: 400
                      details:
                        srcChainId: 1
                        srcToken: '0x0000000000000000000000000000000000000000'
                        dstChainId: 42161
                        dstToken: '0x1234567890123456789012345678901234567890'
                      timestamp: '2024-01-01T00:00:00.000Z'
                UNSUPPORTED_SWAP_DIRECTION:
                  summary: Unsupported Swap Direction
                  value:
                    success: false
                    error:
                      code: UNSUPPORTED_SWAP_DIRECTION
                      name: UnsupportedSwapDirectionError
                      message: The specified swap direction is not supported.
                      title: Unsupported swap direction
                      statusCode: 400
                      details:
                        swapDirection: exact-amount-out
                      timestamp: '2024-01-01T00:00:00.000Z'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                INVALID_API_KEY:
                  summary: Invalid API Key
                  value:
                    success: false
                    error:
                      code: INVALID_API_KEY
                      name: InvalidApiKeyError
                      message: The provided API key is invalid.
                      title: Invalid API key
                      statusCode: 401
                      timestamp: '2024-01-01T00:00:00.000Z'
                MISSING_API_KEY:
                  summary: Missing API Key
                  value:
                    success: false
                    error:
                      code: MISSING_API_KEY
                      name: MissingApiKeyError
                      message: API key is required.
                      title: Missing API key
                      statusCode: 401
                      timestamp: '2024-01-01T00:00:00.000Z'
        '403':
          description: Forbidden - Access denied due to restrictions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                GEO_BLOCKED:
                  summary: Geographic Restriction
                  value:
                    success: false
                    error:
                      code: GEO_BLOCKED
                      name: GeoBlockingError
                      message: Access denied due to geo-blocking restrictions.
                      title: Geo-blocking restriction
                      statusCode: 403
                      details:
                        countryCode: US
                        countryName: United States
                        reason: Country is on the blocked list
                        blockedAt: '2024-01-15T10:30:00.000Z'
                      timestamp: '2024-01-01T00:00:00.000Z'
                WALLET_SCREENED:
                  summary: Wallet Screening
                  value:
                    success: false
                    error:
                      code: WALLET_SCREENED
                      name: WalletScreeningError
                      message: Access denied due to wallet screening restrictions.
                      title: Wallet screening restriction
                      statusCode: 403
                      details:
                        walletAddress: '0x1234567890123456789012345678901234567890'
                        chainId: 1
                        riskLevel: HIGH
                        reason: Wallet flagged by screening service
                        screenedAt: '2024-01-15T10:30:00.000Z'
                      timestamp: '2024-01-01T00:00:00.000Z'
        '405':
          description: Method not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                METHOD_NOT_ALLOWED:
                  summary: Method Not Allowed
                  value:
                    success: false
                    error:
                      code: METHOD_NOT_ALLOWED
                      name: MethodNotAllowedError
                      message: The HTTP request method specified is not allowed.
                      title: Method not allowed
                      statusCode: 405
                      details:
                        method: POST
                      timestamp: '2024-01-01T00:00:00.000Z'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetActionErrorResponse'
              examples:
                INTERNAL_SERVER_ERROR:
                  summary: Internal Server Error
                  value:
                    success: false
                    error:
                      code: INTERNAL_SERVER_ERROR
                      name: InternalServerError
                      message: >-
                        An internal server error occurred while processing the
                        request.
                      title: Internal Server Error
                      statusCode: 500
                      timestamp: '2024-01-01T00:00:00.000Z'
      servers:
        - url: https://api-v2.swaps.xyz/api
          description: Core Swap API server
components:
  schemas:
    ActionType:
      type: string
      enum:
        - swap-action
        - evm-calldata-tx
        - polymarket
      description: Type of action to perform.
    Address:
      type: string
      description: >-
        Address type - can be EvmAddress, HyperCoreAddress, SolanaAddress, or
        AltVmAddress.
    ChainId:
      type: integer
      description: Chain ID. Find in the list of supported networks.
    SwapDirection:
      type: string
      enum:
        - exact-amount-in
        - exact-amount-out
      description: Swap direction for the action.
    Hex:
      type: string
      pattern: ^0x[a-fA-F0-9]*$
      description: Hex string with 0x prefix
    BridgeId:
      type: string
      description: Bridge protocol identifier (e.g. "across", "relay", "mayan").
    ActionResponse:
      type: object
      required:
        - tx
        - txId
        - vmId
        - amountIn
        - amountInMax
        - amountOutMin
        - amountOut
        - protocolFee
        - applicationFee
        - exchangeRate
        - estimatedTxTime
        - estimatedPriceImpact
        - allRoutes
        - requiresTokenApproval
        - requiresRegisterTransaction
      properties:
        tx:
          oneOf:
            - $ref: '#/components/schemas/EvmTransaction'
              title: EVM Transaction
            - $ref: '#/components/schemas/SerializedSolTransaction'
              title: Solana Transaction
            - $ref: '#/components/schemas/AltVmTransaction'
              title: Alt VM Transaction
            - $ref: '#/components/schemas/HyperCoreTransaction'
              title: HyperCore Transaction
          description: Transaction data for execution
        txId:
          $ref: '#/components/schemas/Hex'
          description: Transaction ID
        vmId:
          type: string
          enum:
            - evm
            - solana
            - alt-vm
            - hypercore
          description: Virtual machine identifier.
        amountIn:
          $ref: '#/components/schemas/Payment'
          description: >-
            Expected amount to input (exclusive of slippage - recommended value
            to display in frontend)
        amountInMax:
          $ref: '#/components/schemas/Payment'
          description: Maximum amount to input (inclusive of slippage)
        amountOut:
          $ref: '#/components/schemas/Payment'
          description: >-
            Expected amount delivered to users (exclusive of slippage -
            recommended value to display in frontend)
        amountOutMin:
          $ref: '#/components/schemas/Payment'
          description: Minimum amount delivered to users (inclusive of slippage)
        protocolFee:
          $ref: '#/components/schemas/Payment'
          description: Swaps.xyz fee
        applicationFee:
          $ref: '#/components/schemas/Payment'
          description: Application fee (your fee!)
        bridgeFee:
          $ref: '#/components/schemas/Payment'
          description: Bridge fee (from aggregated providers)
        bridgeIds:
          type: array
          items:
            $ref: '#/components/schemas/BridgeId'
          description: Bridge IDs used in the route.
        bridgeRoute:
          $ref: '#/components/schemas/BridgeRoute'
          description: >-
            Bridge route information (src chain + token, dst chain + token,
            BridgeId)
        exchangeRate:
          type: number
          format: float
          description: Exchange rate for the swap.
        estimatedTxTime:
          type: number
          format: float
          description: Estimated transaction time in seconds.
        estimatedPriceImpact:
          type: number
          format: float
          description: Estimated price impact percentage.
        requiresTokenApproval:
          type: boolean
          description: >-
            Flag indicating whether the transaction object requires a source
            token approval check.
        requiresRegisterTransaction:
          type: boolean
          description: >-
            Flag indicating whether the transaction requires registration via
            the registerTxs endpoint. Mandatory for non-EVM transactions.
        allRoutes:
          type: array
          items:
            $ref: '#/components/schemas/BaseActionResponse'
          description: All available routes for the action.
        executionsType:
          type: string
          enum:
            - DEFAULT
            - GASLESS
          description: >-
            Indicates the execution mode. `GASLESS` when `gasless=true` was
            requested and a relay provider is available; `DEFAULT` otherwise.
        executions:
          type: array
          items:
            $ref: '#/components/schemas/Execution'
          description: >-
            Ordered list of signing steps the client must complete before
            calling `POST /submitTx`. Only present when `executionsType` is
            `GASLESS`.
        relayerFee:
          $ref: '#/components/schemas/Payment'
          description: >-
            Fee charged by the relay provider, denominated in USDT. If non-zero,
            the user must hold USDT in addition to the source token. Only
            present when `executionsType` is `GASLESS`.
    GetActionErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Always false for error responses
          enum:
            - false
          example: false
        error:
          type: object
          required:
            - code
            - name
            - message
            - title
            - statusCode
            - timestamp
          properties:
            code:
              type: string
              description: Error type code for programmatic handling
              enum:
                - AMOUNT_TOO_HIGH
                - AMOUNT_TOO_LOW
                - CROSS_VM_RECEIVER_REQUIRED
                - EXCESSIVE_FEE
                - GEO_BLOCKED
                - INSUFFICIENT_LIQUIDITY
                - INVALID_ADDRESS_FORMAT
                - INVALID_AMOUNT_ZERO
                - INVALID_API_KEY
                - INVALID_DESTINATION_TOKEN
                - INVALID_PARAMETER
                - INVALID_SOURCE_TOKEN
                - INTERNAL_SERVER_ERROR
                - METHOD_NOT_ALLOWED
                - MISSING_API_KEY
                - MISSING_REQUIRED_FIELD
                - NO_AVAILABLE_ROUTE
                - UNSUPPORTED_NETWORK
                - UNSUPPORTED_NETWORK_PAIR
                - UNSUPPORTED_NETWORK_TOKEN_PAIR
                - UNSUPPORTED_SWAP_DIRECTION
                - WALLET_SCREENED
            name:
              type: string
              description: Error class name
              example: InvalidAddressError
            message:
              type: string
              description: Detailed error message
              example: The format of the specified address is invalid.
            title:
              type: string
              description: Short, user-friendly error title
              example: Invalid address format
            statusCode:
              type: integer
              description: HTTP status code
              example: 400
            details:
              type: object
              description: >-
                Additional context about the error, including invalid values and
                suggestions
              properties:
                field:
                  type: string
                  description: The field that caused the error
                address:
                  type: string
                  description: The invalid address value
                reason:
                  type: string
                  description: Explanation of why the value is invalid
              additionalProperties: true
              example:
                field: srcToken
                address: 0xinvalid
                reason: Address must be 40 characters long
            timestamp:
              type: string
              description: ISO 8601 timestamp when the error occurred
              example: '2024-01-01T00:00:00.000Z'
    EvmTransaction:
      type: object
      required:
        - to
        - data
        - value
      properties:
        to:
          $ref: '#/components/schemas/EvmAddress'
        data:
          $ref: '#/components/schemas/Hex'
        value:
          type: string
          pattern: ^[0-9]+$
          description: Value in wei as string
        chainId:
          $ref: '#/components/schemas/ChainId'
    SerializedSolTransaction:
      type: object
      required:
        - base64Tx
        - recentBlockhash
        - payer
      properties:
        base64Tx:
          type: string
          description: Base64-encoded transaction
        recentBlockhash:
          type: string
          description: Recent blockhash for transaction validity
        payer:
          $ref: '#/components/schemas/SolanaAddress'
          description: PublicKey who pays fees
    AltVmTransaction:
      type: object
      required:
        - to
        - toExtra
        - value
        - chainId
        - chainKey
      properties:
        to:
          $ref: '#/components/schemas/ExchangeAddress'
          description: Exchange address
        toExtra:
          type: string
          nullable: true
          description: Additional address information (e.g., memo, tag). Can be null.
        value:
          type: string
          pattern: ^[0-9]+$
          description: Value as string
        chainId:
          $ref: '#/components/schemas/ChainId'
        chainKey:
          type: string
          description: Chain key identifier
    HyperCoreTransaction:
      type: object
      required:
        - type
        - destination
        - amount
        - chainId
      properties:
        type:
          $ref: '#/components/schemas/HyperCoreAction'
        destination:
          type: string
          description: Destination address
        amount:
          type: string
          description: Amount to transfer
        chainId:
          $ref: '#/components/schemas/ChainId'
          description: Chain ID. 1337 for HyperCore
    Payment:
      allOf:
        - $ref: '#/components/schemas/TokenInfo'
        - type: object
          required:
            - amount
          properties:
            amount:
              type: string
              pattern: ^[0-9]+$
            usdAmount:
              type: number
              format: float
              description: USD value of the payment amount
    BridgeRoute:
      type: array
      items:
        $ref: '#/components/schemas/BridgeStep'
      description: Array of bridge steps
    BaseActionResponse:
      type: object
      required:
        - tx
        - txId
        - amountIn
        - vmId
        - amountInMax
        - amountOutMin
        - amountOut
        - protocolFee
        - applicationFee
        - exchangeRate
        - estimatedTxTime
        - estimatedPriceImpact
        - requiresRegisterTransaction
      properties:
        tx:
          oneOf:
            - $ref: '#/components/schemas/EvmTransaction'
              title: EVM Transaction
            - $ref: '#/components/schemas/SerializedSolTransaction'
              title: Solana Transaction
            - $ref: '#/components/schemas/AltVmTransaction'
              title: Alt VM Transaction
            - $ref: '#/components/schemas/HyperCoreTransaction'
              title: HyperCore Transaction
          description: Transaction data for execution
        txId:
          $ref: '#/components/schemas/Hex'
          description: Transaction ID
        vmId:
          type: string
          enum:
            - evm
            - solana
            - alt-vm
            - hypercore
          description: Virtual machine identifier.
        amountIn:
          $ref: '#/components/schemas/Payment'
          description: >-
            Expected amount to input (exclusive of slippage - recommended value
            to display in frontend)
        amountInMax:
          $ref: '#/components/schemas/Payment'
          description: Maximum amount to input (inclusive of slippage)
        amountOut:
          $ref: '#/components/schemas/Payment'
          description: >-
            Expected amount delivered to users (exclusive of slippage -
            recommended value to display in frontend)
        amountOutMin:
          $ref: '#/components/schemas/Payment'
          description: Minimum amount delivered to users (inclusive of slippage)
        protocolFee:
          $ref: '#/components/schemas/Payment'
          description: Swaps.xyz fee
        applicationFee:
          $ref: '#/components/schemas/Payment'
          description: Application fee (your fee!)
        bridgeFee:
          $ref: '#/components/schemas/Payment'
          description: Bridge fee (from aggregated providers)
        bridgeIds:
          type: array
          items:
            $ref: '#/components/schemas/BridgeId'
          description: Bridge IDs used in the route.
        bridgeRoute:
          $ref: '#/components/schemas/BridgeRoute'
          description: >-
            Bridge route information (src chain + token, dst chain + token,
            BridgeId)
        exchangeRate:
          type: number
          format: float
          description: Exchange rate for the swap.
        estimatedTxTime:
          type: number
          format: float
          description: Estimated transaction time in seconds.
        estimatedPriceImpact:
          type: number
          format: float
          description: Estimated price impact percentage.
        requiresRegisterTransaction:
          type: boolean
          description: >-
            Flag indicating whether the transaction requires registration via
            the registerTxs endpoint. Mandatory for non-EVM transactions.
        executionsType:
          type: string
          enum:
            - DEFAULT
            - GASLESS
          description: >-
            Indicates the execution mode. `GASLESS` when `gasless=true` was
            requested and a relay provider is available; `DEFAULT` otherwise.
        executions:
          type: array
          items:
            $ref: '#/components/schemas/Execution'
          description: >-
            Ordered list of signing steps the client must complete before
            calling `POST /submitTx`. Only present when `executionsType` is
            `GASLESS`.
        relayerFee:
          $ref: '#/components/schemas/Payment'
          description: >-
            Fee charged by the relay provider, denominated in USDT. If non-zero,
            the user must hold USDT in addition to the source token. Only
            present when `executionsType` is `GASLESS`.
    Execution:
      description: >-
        A single signing step returned in the `executions` array of a gasless
        `getAction` response. Only available for Tron same-chain swaps. The
        client must sign each item in order and include the signatures when
        calling `POST /submitTx`.
      oneOf:
        - $ref: '#/components/schemas/EvmTransactionSignExecution'
        - $ref: '#/components/schemas/EvmSignTypedDataExecution'
      discriminator:
        propertyName: txType
        mapping:
          evmTransactionSign:
            $ref: '#/components/schemas/EvmTransactionSignExecution'
          evmSignTypedData:
            $ref: '#/components/schemas/EvmSignTypedDataExecution'
    EvmAddress:
      type: string
      pattern: ^0x[a-fA-F0-9]{40}$
      description: EVM address (0x prefix + 40 hex characters)
    SolanaAddress:
      type: string
      pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
      description: Solana public key (base58 encoded, 32-44 characters)
    ExchangeAddress:
      type: string
      description: Exchange address format
    HyperCoreAction:
      type: string
      enum:
        - usdSend
      description: HyperCore action type
    TokenInfo:
      type: object
      required:
        - chainId
        - address
        - name
        - symbol
        - decimals
        - isNative
      properties:
        chainId:
          $ref: '#/components/schemas/ChainId'
          description: Chain ID for the token
        address:
          $ref: '#/components/schemas/Address'
          description: Token address
        name:
          type: string
          description: Token name
        symbol:
          type: string
          description: Token symbol
        decimals:
          type: integer
          description: Token decimals
        isNative:
          type: boolean
          description: Boolean flag for whether token is the chain's gas token.
        logo:
          type: string
          nullable: true
          description: URL to the token's logo image. Can be null if logo is not available.
        swapsXyzCode:
          type: string
          description: Internal Swaps.xyz token identifier code.
    BridgeStep:
      type: object
      required:
        - srcChainId
        - dstChainId
        - srcBridgeToken
        - dstBridgeToken
        - bridgeId
      properties:
        srcChainId:
          $ref: '#/components/schemas/ChainId'
        dstChainId:
          $ref: '#/components/schemas/ChainId'
        srcBridgeToken:
          $ref: '#/components/schemas/Address'
        dstBridgeToken:
          $ref: '#/components/schemas/Address'
        bridgeId:
          $ref: '#/components/schemas/BridgeId'
    EvmTransactionSignExecution:
      type: object
      required:
        - txType
        - data
        - signature
      properties:
        txType:
          type: string
          enum:
            - evmTransactionSign
        data:
          type: string
          description: >-
            JSON string of an unsigned Tron transaction (TronWeb `raw_data`
            shape)
        signature:
          type: string
          description: Hex-encoded signature from TronLink or compatible Tron wallet
    EvmSignTypedDataExecution:
      type: object
      required:
        - txType
        - data
        - signature
      properties:
        txType:
          type: string
          enum:
            - evmSignTypedData
        data:
          description: >-
            EIP-712 typed data to sign. Accepted as either a JSON string (same
            format returned by `GET /getAction`) or a parsed object — both are
            equivalent.
          oneOf:
            - type: string
              description: JSON-encoded EIP-712 typed data
            - $ref: '#/components/schemas/Eip712Data'
        signature:
          type: string
          description: Hex-encoded EIP-712 signature
    Eip712Data:
      type: object
      required:
        - domain
        - types
        - message
      properties:
        domain:
          $ref: '#/components/schemas/Eip712Domain'
        types:
          type: object
          description: EIP-712 type definitions (field name → array of {name, type} pairs)
          additionalProperties:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                type:
                  type: string
        message:
          type: object
          description: The typed data message payload
          additionalProperties: true
    Eip712Domain:
      type: object
      required:
        - name
        - version
        - chainId
        - verifyingContract
      properties:
        name:
          type: string
          description: EIP-712 domain name
        version:
          type: string
          description: EIP-712 domain version
        chainId:
          type: integer
          description: Chain ID the typed data is bound to
        verifyingContract:
          type: string
          description: Address of the contract verifying the signature
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Limited demo key for API Reference: `5c951bc81da566bbd030ba8e20724063`.'

````