gasPrice - Ethereum Classic

Returns the current gas price in wei. Ethereum Classic uses legacy gas pricing, so this is the price to set on a transaction.

Schema

graphqlgasPrice: BigInt!

Query

graphqlquery {
  gasPrice
}

Example

bashexport ETC_GRAPHQL=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl --location --request POST "${ETC_GRAPHQL}graphql" \
--header 'Content-Type: application/json' \
--data-raw '{"query": "query { gasPrice }"}'

Response

json{
    "data": {
        "gasPrice": "1000000000"
    }
}

Response Fields

FieldTypeDescription
gasPriceBigIntCurrent gas price in wei

Use Cases

  • Fee Estimation: Set gasPrice on a legacy transaction
  • Cost Monitoring: Track gas price over time
  • Wallets: Populate the fee field

Error Handling

ErrorMessageDescription
errors[]internal errorThe node failed to return the gas price
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect