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

# adjacentTransactions | TON v3

> The adjacentTransactions endpoint retrieves a list of transactions adjacent to a specific transaction in the TON blockchain. On TON v3.

The `adjacentTransactions` endpoint retrieves a list of transactions adjacent to a specific transaction in the TON blockchain. This endpoint allows you to fetch transactions that occurred before or after a given transaction, providing context and enabling transaction flow analysis.

<Note>
  **TON billing: full (1 RU)**

  This method is always billed as full. See [Request units — TON method scope](/docs/request-units#ton-method-scope).
</Note>

## Parameters

* `hash` (string, required) — The hash of the reference transaction. Example: `a9d39a7f1e5f849835496b052885ed2ac07d54d5e0e11f2b17c3b00e3295a2b0`.
* `direction` (string, required) — The direction of adjacent transactions to retrieve. Possible values: `before`, `after`, or `both`. Default: `both`.
* `limit` (integer, optional) — The maximum number of transactions to return. Default: `128`.
* `offset` (integer, optional) — The number of transactions to skip before starting to return results. Default: `0`.
* `sort` (string, optional) — The sorting order of the transactions. Possible values: `asc` (ascending) or `desc` (descending). Default: `desc`.

## Response

* `transactions` (array) — An array of transaction objects, each containing:
  * `hash` (string) — The transaction hash.
  * `lt` (string) — The logical time of the transaction.
  * `account` (string) — The account address involved in the transaction.
  * `now` (integer) — The timestamp of the transaction.
  * `origStatus` (string) — The original status of the account.
  * `endStatus` (string) — The end status of the account.
  * `totalFees` (string) — The total fees for the transaction.

## Use case

The `adjacentTransactions` endpoint is useful for various applications that need to analyze transaction sequences or provide context around specific transactions:

1. Block explorers can use this to show transactions that occurred before and after a specific transaction, helping users understand the transaction flow.
2. Analytics tools can use this endpoint to track transaction chains and analyze patterns in transaction sequences.
3. Wallet applications can provide users with a broader context of their transactions by showing adjacent transactions from the same account or related accounts.
4. Debugging tools for smart contracts can use this to trace the execution flow of transactions and their effects on the blockchain state.


## OpenAPI

````yaml openapi/ton_node_api/v3/getAdjacentTransactions.json GET /adjacentTransactions
openapi: 3.0.0
info:
  title: TON API
  version: 3.0.0
  description: API for interacting with The Open Network (TON) blockchain
servers:
  - url: >-
      https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v3
security: []
paths:
  /adjacentTransactions:
    get:
      tags:
        - Blockchain
      summary: Get Adjacent Transactions
      description: Retrieves a list of transactions adjacent to a specific transaction
      operationId: getAdjacentTransactions
      parameters:
        - name: hash
          in: query
          description: The hash of the reference transaction
          required: true
          schema:
            type: string
            default: a9d39a7f1e5f849835496b052885ed2ac07d54d5e0e11f2b17c3b00e3295a2b0
        - name: direction
          in: query
          description: The direction of adjacent transactions to retrieve
          required: true
          schema:
            type: string
            enum:
              - before
              - after
              - both
            default: both
        - name: limit
          in: query
          description: The maximum number of transactions to return
          required: false
          schema:
            type: integer
            default: 128
        - name: offset
          in: query
          description: The number of transactions to skip before starting to return results
          required: false
          schema:
            type: integer
            default: 0
        - name: sort
          in: query
          description: The sorting order of the transactions
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    type: array
                    items:
                      type: object
                      properties:
                        hash:
                          type: string
                          description: The transaction hash
                        lt:
                          type: string
                          description: The logical time of the transaction
                        account:
                          type: string
                          description: The account address involved in the transaction
                        now:
                          type: integer
                          description: The timestamp of the transaction
                        origStatus:
                          type: string
                          description: The original status of the account
                        endStatus:
                          type: string
                          description: The end status of the account
                        totalFees:
                          type: string
                          description: The total fees for the transaction

````