跳转到主要内容
POST
/
api
/
v1
/
transactions
/
estimate-gas
估算 Gas
curl --request POST \
  --url https://api.example.com/api/v1/transactions/estimate-gas \
  --header 'Content-Type: application/json' \
  --data '
{
  "chainId": 8453,
  "from": "0xabc1230000000000000000000000000000000000",
  "to": "0xdef4560000000000000000000000000000000000",
  "amount": "0.1"
}
'
{
  "code": 0,
  "msg": "ok",
  "data": {
    "chainId": 8453,
    "gasLimit": 21000,
    "gasPriceGwei": 1.2,
    "estimatedFeeNative": 0.0000252,
    "estimatedFeeUsd": 0.09,
    "confidence": "high",
    "updatedAt": "2026-05-11T10:00:00.000Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.nexfi.robert.dpdns.org/llms.txt

Use this file to discover all available pages before exploring further.

请求体

application/json

Gas 估算请求体。

chainId
integer
必填

链 ID。

示例:

8453

from
string
必填

发起地址。

示例:

"0xabc1230000000000000000000000000000000000"

to
string
必填

目标地址。

示例:

"0xdef4560000000000000000000000000000000000"

amount
string
必填

十进制字符串金额。

示例:

"0.1"

tokenAddress
string

代币地址;原生币转账可省略或置空。

示例:

"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"

响应

200 - application/json

成功返回 Gas 估算

统一响应包裹结构。

code
integer
必填

业务状态码,0 表示成功。

示例:

0

msg
string
必填

可读返回消息。

示例:

"ok"

data
object

Gas 估算结果。