> For the complete documentation index, see [llms.txt](https://docs.chiliz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiliz.com/jp/kaihatsu/joukyu/gas-fee-mitsumori.md).

# gas fee を見積もる

トランザクション手数料（または「gas fee」）はネットワークの活動状況によって大きく変動することがあるため、スムーズなユーザー体験のためには信頼できる見積もり方法を用意しておくことが重要です。

{% hint style="warning" %}
トランザクションが長時間「pending」状態のままにならないようにするには、手数料をまかなえるだけの十分な金額を含める必要があります。

* 最低 gas fee: 2,501 Gwei。
* 最低 priority fee: 1 Gwei。
  {% endhint %}

## Chiliz Chain 開発者にとってどういう意味があるのか？

他のあらゆるブロックチェーンと同様に、Chiliz Chain 上のすべてのトランザクションには gas を支払う必要があります。

重要なのは、トランザクションの失敗や遅延を避けるために、コスト効率とタイムリーな承認のバランスを取ることです。gas の見積もりを常に最新の状態に保つことで、払いすぎと払わなすぎの両方を防げます。

## ネイティブに行う方法

*vanilla*（素のまま）でやりたい場合は、[Chiliz Chain RPC サーバー](/jp/kaihatsu/kihon/chiliz-chain-setsuzoku/rpc-setsuzoku.md)への [cURL](https://curl.se/) リクエストに頼ることができます。こちらを参照してください: #how-to-get-the-current-gas-price。

## explorer API を通じて行う方法

[Chiliscan](https://chiliscan.com/) と [Chiliz Block Explorer](https://scan.chiliz.com/) はいずれも、Chiliz Chain の現在の gas price を取得できる API を提供しています。

{% hint style="warning" %}
利用可能な API のメソッド/エンドポイントを操作するには、API キーが必要です。
{% endhint %}

{% hint style="info" %}
どちらの explorer にも「Gas tracker」ページがあります。

* <https://chiliscan.com/insight/leaderboard/gas-tracker>
* <https://scan.chiliz.com/gas-tracker>
  {% endhint %}

### Chiliscan の API を使う

Chiliscan API は、その目的のために `avg-gas-price` メソッドを提供しています。

{% embed url="<https://chiliscan.com/documentation/api/swagger>" %}

{% code overflow="wrap" %}

```bash
curl -X 'GET' \
  'https://api.routescan.io/v2/network/mainnet/evm/88888/aggregations/avg-gas-price?apikey=YourApiKeyToken' \
  -H 'accept: application/json'
```

{% endcode %}

... これにより、現在の値を含む JSON 文字列が返されます。

### Chiliz Block Explorer の API を使う

Chiliz Block Explorer API には、その情報を提供する stats エンドポイントがあります。

{% embed url="<https://scan.chiliz.com/api-docs?tab=rest_api>" %}

```bash
curl -X 'GET' \
  'https://scan-api.chiliz.com/api/v2/stats' \
  -H 'accept: application/json'
```

このエンドポイントは gas price 情報を含むデータを返します。例:

```json
{
  "total_blocks": "508700",
  "total_addresses": "982340",
  "total_transactions": "1699427",
  "average_block_time": 25000,
  "coin_price": "0.00254957",
  "total_gas_used": "0",
  "transactions_today": "622",
  "gas_used_today": "49063630",
  "gas_prices": {
    "average": 10,
    "fast": 10,
    "slow": 10
  },
  "static_gas_price": "10.1",
  "market_cap": "420471.10604559750644",
  "network_utilization_percentage": 40.2142
}
```

このセクションを使うとよいでしょう（価格の単位は Gwei です）。

```json
"gas_prices": {
    "average": 10,
    "fast": 10,
    "slow": 10
  },
```

{% hint style="info" %}

* `average` は、適度なコストと、次の数ブロック以内での確実な取り込みのバランスを取ります。
* `fast` は最も高いプレミアムを支払い、validator にあなたのトランザクションを即座に優先させるインセンティブを与え、緊急のニーズに対して可能な限り最速の承認を保証します。
* `slow` は最も低い手数料ですが、ネットワークの混雑が増した場合にトランザクションが pending のままになるリスクを伴います。
  {% endhint %}

## Blocknative を使って行う方法

[Blocknative](https://www.blocknative.com/) は、パブリックブロックチェーンネットワーク上での取引の複雑さを監視・管理するためのインフラを構築しています。

Blocknative の [Gas API](https://docs.blocknative.com/gas-prediction/gas-platform) は、gas price を取得するための信頼性が高くリアルタイムなアプローチを提供します。

### ステップ 1: キーを取得する

プロジェクトで Blocknative の Gas API を使うには、API キーが必要です。

まず [Gas Network に参加する](https://www.gas.network/)必要があり、これにより自分専用の API キーにアクセスできるようになります。

### ステップ 2: Gas API への呼び出しを実装する

API キーを取得したら、Chiliz の手数料見積もりをリクエストできます。

{% hint style="info" %}
Chiliz Chain Mainnet の chain ID は `88888` であることを思い出してください。
{% endhint %}

最もシンプルな方法は、REST リクエストで API を呼び出すことです。たとえば、コマンドラインから:

{% code overflow="wrap" %}

```bash
curl -H "Authorization: your-apikey-here" \
  'https://api.blocknative.com/gasprices/blockprices?chainid=88888'
```

{% endcode %}

詳しくは [Blocknative のドキュメント](https://docs.blocknative.com/gas-prediction/gas-platform)を参照してください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chiliz.com/jp/kaihatsu/joukyu/gas-fee-mitsumori.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
