Skip to main content

Estimate gas price

GEThttps://mainnet-aptos-api.moralis.io/transactions/estimate_gas_price

Estimate gas price based on current network load.

Responses
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.AptosApi.transactions.estimateGasPrice({
"network": "mainnet"
});

console.log(response);
} catch (e) {
console.error(e);
}
Response Example
{
"deprioritized_gas_estimate": 0,
"gas_estimate": 0,
"prioritized_gas_estimate": 0
}