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

# 交易 - 估算 Gas Limit

> 估算 EVM 交易的 Gas Limit



## OpenAPI

````yaml /zh-Hant/api-reference/openapi-defi-zh-Hant.yaml POST /v2/transaction/{chain}/estimate-gas-limit
openapi: 3.1.0
info:
  title: Defi Service API
  description: Defi Service API ⚡️
  version: '1.0'
  contact:
    name: AI
    url: https://github.com/chainstream-io/defi-service
    email: ai@sx.ai
servers:
  - url: https://api.chainstream.io
    description: Production
security: []
tags:
  - name: Endpoints
    description: ''
paths:
  /v2/transaction/{chain}/estimate-gas-limit:
    post:
      tags:
        - Transaction
      summary: 交易 - 估算 Gas Limit
      description: 估算 EVM 交易的 Gas Limit
      operationId: get.gasLimit
      parameters:
        - name: chain
          required: true
          in: path
          description: 支援網路列表中的鏈名稱
          schema:
            enum:
              - bsc
              - eth
            type: string
      requestBody:
        required: true
        description: Gas 估算參數
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateGasLimitInput'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateGasLimitResponse'
      security:
        - bearer: []
components:
  schemas:
    EstimateGasLimitInput:
      type: object
      properties:
        from:
          type: string
          description: From address
          example: '0x742d35Cc6634C0532925a3b8D8C9C4b8a8d4C8b8'
        to:
          type: string
          description: To address
          example: '0x742d35Cc6634C0532925a3b8D8C9C4b8a8d4C8b8'
        data:
          type: string
          description: Transaction data (hex)
          example: >-
            0xa9059cbb000000000000000000000000742d35cc6634c0532925a3b8d8c9c4b8a8d4c8b80000000000000000000000000000000000000000000000000de0b6b3a7640000
        value:
          type: string
          description: Value to send (in wei, hex string)
          example: '0x0'
      required:
        - from
        - to
        - data
    EstimateGasLimitResponse:
      type: object
      properties:
        gasLimit:
          type: string
          description: Estimated gas limit (hex string)
          example: '0x5208'
        chain:
          type: string
          description: Chain symbol
          example: ethereum
      required:
        - gasLimit
        - chain
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````