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.
Parameters
Request Example
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"
}'const axios = require('axios');
axios.post("https://go.getblock.io/<ACCESS-TOKEN>/", {
jsonrpc: "2.0", method: "suix_getReferenceGasPrice", params: [], id: "getblock.io"
}).then(r => console.log("Gas Price:", r.data.result));import requests
url = "https://go.getblock.io/<ACCESS-TOKEN>/"
payload = {"jsonrpc": "2.0", "method": "suix_getReferenceGasPrice", "params": [], "id": "getblock.io"}
response = requests.post(url, headers={"Content-Type": "application/json"}, json=payload)
print("Gas Price:", response.json().get("result"))use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let payload = json!({"jsonrpc": "2.0", "id": "getblock.io", "method": "suix_getReferenceGasPrice", "params": []});
let response = client.post("https://go.getblock.io/<ACCESS-TOKEN>/").json(&payload).send().await?;
println!("Response: {:?}", response.text().await?);
Ok(())
}Response Sample
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": "1000"
}Response Parameters
Parameter
Type
Description
Use Cases
Error Handling
Web3 Integration
Last updated
Was this helpful?