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

# Send signed swap transactions

> Sends transactions that were already signed by the caller's wallet and returns transaction IDs that can be tracked.

```bash theme={null}
curl -X POST "https://staging-api.struct.to/v1/trading/tx/submit?fields=short" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chain_id":4663,"wallet_address":"0x12a371444CCeBb6B64Cc35EBbC70d1d998433d51","signed_transactions":[{"signed_transaction":"0x02f8b3...","encoding":"hex"}]}'
```

```json Response (Long) theme={null}
{
  "trade_id": "7c4a8d09-ca37-62af-61d5-3583ec55ad30",
  "status": "submitted",
  "transaction_ids": [
    "0x7c4a8d09ca3762af61d53583ec55ad30131148048f16944d19399c267a8a4b8f"
  ]
}
```

```jsonc Response (Short) theme={null}
{
  "id": "7c4a8d09-ca37-62af-61d5-3583ec55ad30",
  "st": "submitted",
  "tx": [
    "0x7c4a8d09ca3762af61d53583ec55ad30131148048f16944d19399c267a8a4b8f"
  ]
}
```


## OpenAPI

````yaml onchain-openapi.json POST /trading/tx/submit
openapi: 3.1.0
info:
  title: Struct On-chain API
  description: >-
    RESTful API for token market data, discovery, holders, audits, and trader
    analytics across supported chains. Pass `fields=short` or header
    `x-field-names: short` for abbreviated keys. HTTP defaults to `long`. Token
    candlesticks, token trades and wallet batch trades also support
    `fields=array` for typed positional rows.
  version: 1.0.0
servers:
  - url: https://staging-api.struct.to/v1
    description: Staging
security:
  - ApiKey: []
paths:
  /trading/tx/submit:
    post:
      tags:
        - DEX Trading
      summary: Send signed swap transactions
      description: >-
        Sends transactions that were already signed by the caller's wallet and
        returns transaction IDs that can be tracked.
      operationId: post_dex_trading_tx_submit
      parameters:
        - name: x-field-names
          in: header
          required: false
          description: >-
            Select long (full) or short (abbreviated) field names. HTTP defaults
            to `long`. Takes precedence over `fields`. See [Response
            Format](/api-reference/response-format#long-and-short-field-names).
          schema:
            type: string
            enum:
              - long
              - short
            default: long
          example: short
        - name: fields
          in: query
          required: false
          description: >-
            Same as `x-field-names`. Use `long` or `short`. HTTP defaults to
            `long`. Ignored when the header is set. `field_names` is accepted as
            an alias.
          schema:
            type: string
            enum:
              - long
              - short
            default: long
          example: short
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRawTransactionsRequest'
            example:
              chain_id: 4663
              wallet_address: '0x12a371444CCeBb6B64Cc35EBbC70d1d998433d51'
              signed_transactions:
                - signed_transaction: 0x02f8b3...
                  encoding: hex
        required: true
      responses:
        '200':
          description: Sent transaction IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitTransactionsResponse'
              examples:
                long:
                  summary: Response (Long)
                  value:
                    trade_id: 7c4a8d09-ca37-62af-61d5-3583ec55ad30
                    status: submitted
                    transaction_ids:
                      - >-
                        0x7c4a8d09ca3762af61d53583ec55ad30131148048f16944d19399c267a8a4b8f
                short:
                  summary: Response (Short)
                  value:
                    id: 7c4a8d09-ca37-62af-61d5-3583ec55ad30
                    st: submitted
                    tx:
                      - >-
                        0x7c4a8d09ca3762af61d53583ec55ad30131148048f16944d19399c267a8a4b8f
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DexTradingErrorEnvelope'
        '501':
          description: Sending is not available for the selected chain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DexTradingErrorEnvelope'
        '502':
          description: Network rejected the transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DexTradingErrorEnvelope'
        '503':
          description: Network temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DexTradingErrorEnvelope'
components:
  schemas:
    SubmitRawTransactionsRequest:
      type: object
      required:
        - chain_id
        - signed_transactions
      properties:
        chain_id:
          $ref: '#/components/schemas/TradingChainId'
          description: Chain id. Use `-1` for Solana or an EVM chain id such as `4663`.
        trade_id:
          type:
            - string
            - 'null'
          format: uuid
        wallet_address:
          type:
            - string
            - 'null'
        signed_transactions:
          type: array
          items:
            $ref: '#/components/schemas/SignedTransactionInput'
        await_confirmation:
          type:
            - boolean
            - 'null'
        idempotency_key:
          type:
            - string
            - 'null'
        metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/TradeRequestMetadata'
    SubmitTransactionsResponse:
      type: object
      required:
        - trade_id
        - status
        - transaction_ids
      properties:
        trade_id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/TradeStatus'
        transaction_ids:
          type: array
          items:
            type: string
    DexTradingErrorEnvelope:
      type: object
      required:
        - success
        - message
        - error_code
        - category
        - retryable
        - data
        - info
      properties:
        success:
          type: boolean
        message:
          type: string
        error_code:
          type: string
        category:
          type: string
        retryable:
          type: boolean
        data:
          type: 'null'
          description: Errors have no response data; this field is always null.
        info:
          $ref: '#/components/schemas/DexTradingErrorInfo'
    TradingChainId:
      type: integer
      format: int64
      example: 4663
    SignedTransactionInput:
      type: object
      required:
        - signed_transaction
      properties:
        signed_transaction:
          type: string
          description: >-
            Signed transaction bytes encoded as hex for EVM or base64 for
            Solana.
        encoding:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SignedTransactionEncoding'
              description: >-
                Encoding of `signed_transaction`. Defaults to `hex` for EVM and
                `base64` for Solana.
        lander:
          type:
            - string
            - 'null'
          description: Optional Solana landing provider label for multi-lander submissions.
    TradeRequestMetadata:
      type: object
      properties:
        reference_id:
          type:
            - string
            - 'null'
          description: Caller-side order, quote, or request identifier.
        source:
          type:
            - string
            - 'null'
          description: Client application or integration label.
        user_id:
          type:
            - string
            - 'null'
          description: Caller-side user identifier.
        account_id:
          type:
            - string
            - 'null'
          description: Caller-side wallet or account grouping identifier.
        attributes:
          type:
            - object
            - 'null'
          description: Additional caller-defined string attributes.
          additionalProperties:
            type: string
          propertyNames:
            type: string
    TradeStatus:
      type: string
      enum:
        - built
        - submitted
        - confirmed
        - failed
        - expired
    DexTradingErrorInfo:
      type: object
      required:
        - version
        - credits_consumed
        - compute_time_ms
      properties:
        version:
          type: string
        credits_consumed:
          type: integer
          format: int32
          minimum: 0
        compute_time_ms:
          type: number
          format: float
    SignedTransactionEncoding:
      type: string
      enum:
        - hex
        - base64
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Secret API key (`sk_*`) or JWT public key (`pk_jwt_*`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.