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

# getTransaction

> Trả về thông tin chi tiết của một giao dịch đã được xác nhận.

## Tham số yêu cầu

<ParamField body="transaction" type="string" required>
  Chữ ký giao dịch Solana dưới dạng chuỗi mã hóa base-58 để tra cứu.
</ParamField>

<ParamField body="transaction" type="string" required>
  Định dạng mã hóa cho dữ liệu giao dịch Solana được trả về.

  * `json`
  * `jsonParsed`
  * `base64`
  * `base58`
</ParamField>

<ParamField body="commitment" type="string">
  Mức cam kết của blockchain để xác minh tính hoàn tất của giao dịch.

  * `confirmed`
  * `finalized`
</ParamField>

<ParamField body="maxSupportedTransactionVersion" type="number">
  Phiên bản giao dịch tối đa được trả về. Đặt thành 1 để nhận các giao dịch legacy, v0 và v1. Nếu bị bỏ qua, yêu cầu sẽ thất bại khi giao dịch có phiên bản.
</ParamField>


## OpenAPI

````yaml vi/openapi/rpc-http/getTransaction.yaml POST /
openapi: 3.1.0
info:
  title: Solana RPC API
  version: 1.0.0
  description: >-
    API truy xuất giao dịch Solana nâng cao để truy cập dữ liệu chi tiết về giao
    dịch, chữ ký và kết quả thực thi từ blockchain Solana.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://mainnet.helius-rpc.com
    description: Điểm cuối RPC Mainnet
  - url: https://devnet.helius-rpc.com
    description: Điểm cuối RPC Devnet
security: []
paths:
  /:
    post:
      tags:
        - RPC
      summary: getTransaction
      description: >
        Truy xuất thông tin chi tiết toàn diện về giao dịch từ blockchain Solana
        bằng chữ ký giao dịch.

        Truy cập dữ liệu đầy đủ, bao gồm các thay đổi tài khoản, chi tiết lệnh,
        lượt chuyển token, nhật ký

        chương trình và trạng thái thực thi. Hỗ trợ dữ liệu đã phân tích, nhiều
        định dạng mã hóa và nhiều phiên bản giao dịch.
      operationId: getTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  description: Phiên bản giao thức JSON-RPC.
                  example: '2.0'
                  default: '2.0'
                id:
                  type: string
                  description: Mã định danh duy nhất cho yêu cầu.
                  example: '1'
                  default: '1'
                method:
                  type: string
                  enum:
                    - getTransaction
                  description: Tên của phương thức RPC cần gọi.
                  example: getTransaction
                  default: getTransaction
                params:
                  type: array
                  description: Các tham số để truy vấn giao dịch Solana theo chữ ký.
                  default:
                    - >-
                      D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff
                  items:
                    oneOf:
                      - type: string
                        description: >-
                          Chữ ký giao dịch Solana dưới dạng chuỗi mã hóa base-58
                          để tra cứu.
                        example: >-
                          D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff
                      - type: string
                        description: >-
                          Định dạng mã hóa cho dữ liệu giao dịch Solana được trả
                          về.
                        enum:
                          - json
                          - jsonParsed
                          - base64
                          - base58
                        example: json
                      - type: object
                        description: >-
                          Các tùy chọn cấu hình nâng cao để truy xuất giao dịch
                          Solana.
                        properties:
                          commitment:
                            type: string
                            description: >-
                              Mức cam kết blockchain để xác minh tính hoàn tất
                              của giao dịch.
                            enum:
                              - confirmed
                              - finalized
                            example: finalized
                          maxSupportedTransactionVersion:
                            type: integer
                            description: >-
                              Phiên bản giao dịch tối đa cần trả về. Đặt thành 1
                              để nhận các giao dịch legacy, v0 và v1. Nếu bỏ
                              qua, yêu cầu sẽ không thành công khi giao dịch có
                              phiên bản.
                            example: 1
      responses:
        '200':
          description: Đã truy xuất thành công dữ liệu chi tiết về giao dịch Solana.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: Phiên bản giao thức JSON-RPC.
                    enum:
                      - '2.0'
                    example: '2.0'
                  id:
                    type: string
                    description: Mã định danh khớp với yêu cầu.
                    example: '1'
                  result:
                    type: object
                    description: >-
                      Thông tin chi tiết đầy đủ về giao dịch Solana, bao gồm dữ
                      liệu thực thi.
                    properties:
                      slot:
                        type: integer
                        description: >-
                          Số slot trên blockchain Solana khi giao dịch này được
                          xử lý.
                        example: 430
                      transaction:
                        type: object
                        description: >-
                          Đối tượng giao dịch Solana toàn diện với mọi thông tin
                          chi tiết về giao dịch.
                        properties:
                          message:
                            type: object
                            description: >-
                              Thông điệp giao dịch Solana chứa các lệnh thực thi
                              chi tiết.
                            properties:
                              accountKeys:
                                type: array
                                description: >-
                                  Danh sách khóa công khai của các tài khoản
                                  Solana tham gia giao dịch.
                                items:
                                  type: string
                                  example: 3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe
                              header:
                                type: object
                                description: >-
                                  Siêu dữ liệu tiêu đề giao dịch Solana cùng
                                  thông tin kiểm soát truy cập.
                                properties:
                                  numReadonlySignedAccounts:
                                    type: integer
                                    description: >-
                                      Số tài khoản Solana chỉ đọc có chữ ký
                                      trong giao dịch.
                                    example: 0
                                  numReadonlyUnsignedAccounts:
                                    type: integer
                                    description: >-
                                      Số tài khoản Solana chỉ đọc không có chữ
                                      ký trong giao dịch.
                                    example: 3
                                  numRequiredSignatures:
                                    type: integer
                                    description: >-
                                      Số chữ ký bắt buộc để xác thực giao dịch
                                      Solana.
                                    example: 1
                              instructions:
                                type: array
                                description: >-
                                  Danh sách lệnh chương trình được thực thi
                                  trong giao dịch Solana.
                                items:
                                  type: object
                                  properties:
                                    accounts:
                                      type: array
                                      description: >-
                                        Danh sách được lập chỉ mục gồm các tài
                                        khoản Solana mà lệnh này truy cập.
                                      items:
                                        type: integer
                                        example: 1
                                    data:
                                      type: string
                                      description: >-
                                        Dữ liệu lệnh đã mã hóa được truyền đến
                                        chương trình Solana.
                                      example: >-
                                        37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1
                                    programIdIndex:
                                      type: integer
                                      description: >-
                                        Chỉ mục của chương trình Solana xử lý
                                        lệnh này.
                                      example: 4
                              recentBlockhash:
                                type: string
                                description: >-
                                  Blockhash Solana gần đây được dùng cho khoảng
                                  thời gian hiệu lực của giao dịch.
                                example: mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B
                          signatures:
                            type: array
                            description: Danh sách chữ ký mật mã xác thực giao dịch Solana.
                            items:
                              type: string
                              example: >-
                                2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv
                      meta:
                        type: object
                        description: Siêu dữ liệu và kết quả thực thi giao dịch Solana.
                        properties:
                          err:
                            oneOf:
                              - type: object
                              - type: 'null'
                            description: >-
                              Thông tin lỗi nếu giao dịch Solana thất bại; null
                              nếu thành công.
                            example: null
                          fee:
                            type: integer
                            description: >-
                              Phí giao dịch được thanh toán bằng lamport Solana
                              (1 SOL = 1.000.000.000 lamport).
                            example: 5000
                          innerInstructions:
                            type: array
                            description: >-
                              Danh sách lệnh nội bộ được tạo trong quá trình
                              thực thi giao dịch Solana.
                            items:
                              type: object
        '400':
          description: >-
            Yêu cầu không hợp lệ - Tham số yêu cầu không hợp lệ hoặc yêu cầu sai
            định dạng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32602
                  message: Tham số không hợp lệ
                id: '1'
        '401':
          description: Chưa được ủy quyền - Khóa API không hợp lệ hoặc bị thiếu.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32001
                  message: Chưa được ủy quyền
                id: '1'
        '429':
          description: Quá nhiều yêu cầu - Đã vượt quá giới hạn tốc độ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32005
                  message: Quá nhiều yêu cầu
                id: '1'
        '500':
          description: Lỗi máy chủ nội bộ - Đã xảy ra lỗi trên máy chủ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32603
                  message: Lỗi nội bộ
                id: '1'
        '503':
          description: Dịch vụ không khả dụng - Dịch vụ tạm thời không khả dụng.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32002
                  message: Dịch vụ không khả dụng
                id: '1'
        '504':
          description: Hết thời gian chờ cổng kết nối - Yêu cầu đã hết thời gian chờ.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                jsonrpc: '2.0'
                error:
                  code: -32003
                  message: Hết thời gian chờ cổng kết nối
                id: '1'
      security:
        - ApiKeyQuery: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Phiên bản giao thức JSON-RPC.
          enum:
            - '2.0'
          example: '2.0'
        error:
          type: object
          properties:
            code:
              type: integer
              description: Mã lỗi.
              example: -32602
            message:
              type: string
              description: Thông báo lỗi.
            data:
              type: object
              description: Dữ liệu bổ sung về lỗi.
        id:
          type: string
          description: Mã định danh khớp với yêu cầu.
          example: '1'
  securitySchemes:
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api-key
      description: >-
        Khóa API Helius của bạn. Bạn có thể nhận khóa miễn phí trong [bảng điều
        khiển](https://dashboard.helius.dev/api-keys).

````