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

# Build Unsigned Transaction

> Quotes with chain-appropriate resolvers, builds an unsigned transaction,
and returns it for the caller to sign locally. SVM returns base64
VersionedTransaction; EVM returns EIP-1559 envelope(s) with optional
approval transaction.



## OpenAPI

````yaml POST /api/v2/swap/transaction
openapi: 3.0.3
info:
  description: Multi-chain DEX trading API for developers
  license:
    name: ''
  title: Shuriken API v2
  version: 2.0.0
servers:
  - url: https://api.shuriken.trade
security: []
tags:
  - description: SplitNOW cross-chain split plan + execute
    name: V2 Splits
  - description: Wallet archive lifecycle (archive / unarchive / bulk-archive)
    name: Wallets
  - description: Token discovery, metadata, and pricing
    name: V2 Tokens
  - description: Quote and execute swaps
    name: V2 Swap
  - description: Limit orders and stop-loss
    name: V2 Trigger
  - description: Managed-agent invocation
    name: V2 Agents
  - description: Portfolio positions and PnL
    name: V2 Portfolio
  - description: User account management
    name: V2 Account
  - description: WebSocket stream discovery, session bootstrap, and channel authorization
    name: V2 WebSocket
  - description: Perpetual trading on Hyperliquid
    name: V2 Perps
  - description: Agent-proposed trade suggestions
    name: V2 Suggestions
paths:
  /api/v2/swap/transaction:
    post:
      tags:
        - V2 Swap
      summary: POST /api/v2/swap/transaction — Build unsigned transaction (raw mode)
      description: |-
        Quotes with chain-appropriate resolvers, builds an unsigned transaction,
        and returns it for the caller to sign locally. SVM returns base64
        VersionedTransaction; EVM returns EIP-1559 envelope(s) with optional
        approval transaction.
      operationId: build_swap_transaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildTransactionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_BuildTransactionResponse'
          description: Unsigned transaction
        '400':
          description: Invalid params or no route
      security:
        - bearer_auth: []
components:
  schemas:
    BuildTransactionRequest:
      description: |-
        POST /api/v2/swap/transaction request body

        Build an unsigned transaction from trade parameters. The caller signs
        locally and submits via `/submit` or directly to chain.
      properties:
        amount:
          description: Amount in base units (e.g., lamports for SOL, wei for EVM)
          type: string
        chain:
          description: 'Chain identifier: "solana", "base", "bsc"'
          type: string
        inputMint:
          description: Token address to sell
          type: string
        outputMint:
          description: Token address to buy
          type: string
        slippageBps:
          description: 'Slippage tolerance in basis points (default: 100 = 1%)'
          format: int32
          type: integer
        walletAddress:
          description: User's own wallet address (not a Shuriken wallet ID)
          type: string
      required:
        - chain
        - inputMint
        - outputMint
        - amount
        - walletAddress
      type: object
    ApiResponse_BuildTransactionResponse:
      description: V2 success response envelope
      properties:
        data:
          description: |-
            Wrapper enum for /transaction response (SVM or EVM).
            Uses `#[serde(untagged)]` so the JSON shape varies by chain.
          oneOf:
            - $ref: '#/components/schemas/SvmBuildTransactionResponse'
            - $ref: '#/components/schemas/EvmBuildTransactionResponse'
        pagination:
          $ref: '#/components/schemas/PaginationInfo'
          nullable: true
        requestId:
          type: string
      required:
        - data
        - requestId
      type: object
    SvmBuildTransactionResponse:
      description: 'SVM build-transaction response: base64 unsigned VersionedTransaction'
      properties:
        chain:
          type: string
        expiresAt:
          type: string
        quoteId:
          type: string
        quoteSummary:
          $ref: '#/components/schemas/QuoteSummary'
        transaction:
          description: Base64-encoded unsigned VersionedTransaction
          type: string
      required:
        - quoteId
        - chain
        - transaction
        - quoteSummary
        - expiresAt
      type: object
    EvmBuildTransactionResponse:
      description: 'EVM build-transaction response: EIP-1559 transaction envelope(s)'
      properties:
        approvalRequired:
          type: boolean
        approvalTransaction:
          $ref: '#/components/schemas/EvmTransactionEnvelope'
          nullable: true
        chain:
          type: string
        chainId:
          format: int64
          minimum: 0
          type: integer
        expiresAt:
          type: string
        quoteId:
          type: string
        quoteSummary:
          $ref: '#/components/schemas/QuoteSummary'
        transaction:
          $ref: '#/components/schemas/EvmTransactionEnvelope'
      required:
        - quoteId
        - chain
        - chainId
        - approvalRequired
        - transaction
        - quoteSummary
        - expiresAt
      type: object
    PaginationInfo:
      description: Page-based pagination info (per RFC)
      properties:
        hasMore:
          type: boolean
        limit:
          format: int32
          minimum: 0
          type: integer
        page:
          format: int32
          minimum: 0
          type: integer
        total:
          format: int32
          minimum: 0
          nullable: true
          type: integer
      required:
        - page
        - limit
        - hasMore
      type: object
    QuoteSummary:
      description: Quote summary returned alongside a built transaction
      properties:
        inputAmount:
          type: string
        minOutputAmount:
          type: string
        outputAmount:
          type: string
        priceImpactPct:
          nullable: true
          type: string
        slippageBps:
          format: int32
          type: integer
      required:
        - inputAmount
        - outputAmount
        - minOutputAmount
        - slippageBps
      type: object
    EvmTransactionEnvelope:
      description: EIP-1559 unsigned transaction envelope for client signing
      properties:
        data:
          type: string
        gasLimit:
          type: string
        maxFeePerGas:
          type: string
        maxPriorityFeePerGas:
          type: string
        to:
          type: string
        value:
          type: string
      required:
        - to
        - data
        - value
        - maxFeePerGas
        - maxPriorityFeePerGas
        - gasLimit
      type: object
  securitySchemes:
    bearer_auth:
      bearerFormat: JWT or sk_{keyId}_{secret}
      description: >-
        Use `Authorization: Bearer <jwt>` for user auth or `Authorization:
        Bearer sk_{keyId}_{secret}` for API key auth.
      scheme: bearer
      type: http

````