suix_getReferenceGasPrice - Sui

Example code for the suix_getReferenceGasPrice JSON-RPC method. Complete guide on how to use suix_getReferenceGasPrice JSON-RPC in GetBlock Web3 documentation.

This method returns the reference gas price for the current epoch on the SUI network. This minimum gas price is determined by validator voting and is essential for setting appropriate transaction gas budgets.

Parameters

  • None

Request Example

curl
curl --location --request POST https://go.getblock.io/<ACCESS-TOKEN>/ \
--header 'Content-Type: application/json' \
--data-raw '{
  "jsonrpc": "2.0",
  "method": "suix_getReferenceGasPrice",
  "params": [],
  "id": "getblock.io"
}'

Response Sample

response.json
{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "result": "1000"
}

Response Parameters

Parameter
Type
Description

result

string

Reference gas price in MIST per gas unit

Use Cases

  1. Transaction Construction

    Set the appropriate gas price when building transactions.

  2. Cost Estimation

    Calculate expected transaction costs before submission.

  3. Gas Price Monitoring

    Track network gas prices for analytics.

Error Handling

Network Error

  • Description: Connection issues

  • Solution: Check endpoint availability

Web3 Integration

Last updated

Was this helpful?