Gas
compareGas
Returns current base fee and priority fee for every EVM chain with estimated USD cost for a simple transfer (hardcoded at 21,000 gas). Sorted cheapest first. Uses live native token prices. Actual tx costs vary by type - token transfers, swaps, etc. use significantly more gas.
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "compareGas",
"params": {},
"id": 1
}'import { Spectrum } from '@spectrumnodes/sdk';
const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' });
const result = await spectrum.core.getGasComparison();
console.log(result);{
"jsonrpc": "2.0",
"result": {
"data": {
"results": [
{
"chain": "optimism",
"baseFeeGwei": 0.0000143,
"priorityFeeGwei": 0.001,
"estimatedTxCostUsd": 0
},
{
"chain": "arbitrum",
"baseFeeGwei": 0.02,
"priorityFeeGwei": 0,
"estimatedTxCostUsd": 0
},
{
"chain": "ethereum",
"baseFeeGwei": 0.546,
"priorityFeeGwei": 0.133,
"estimatedTxCostUsd": 0.03
}
],
"updatedAt": "2026-02-25T15:00:00.000Z"
}
},
"id": 1
}Response Fields
| Field | Type |
|---|---|
data | object |
results | object[] |
chain | string |
baseFeeGwei | number |
priorityFeeGwei | number |
estimatedTxCostUsd | integer |
updatedAt | string |
estimateGas
Estimates the gas required for a transaction without actually sending it. Useful for determining gas limits before submitting transactions.
curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "estimateGas",
"params": {
"chain": "ethereum",
"to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
"id": 1
}'import { Spectrum } from '@spectrumnodes/sdk';
const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' });
const result = await spectrum.core.estimateGas('ethereum', { to: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' });
console.log(result);{
"jsonrpc": "2.0",
"result": {
"data": {
"chain": "ethereum",
"gasEstimate": 21000,
"gasEstimateHex": "0x5208"
}
},
"id": 1
}Parameters
| Name | Required | Description |
|---|---|---|
| chain | yes | Network slug |
| to | yes | Destination address e.g. 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
| from | no | Sender address e.g. 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 |
| value | no | ETH value in hex wei (e.g. 0xde0b6b3a7640000 = 1 ETH) |
| data | no | Contract call data (hex encoded) |
Response Fields
| Field | Type |
|---|---|
data | object |
chain | string |
gasEstimate | integer |
gasEstimateHex | string |
Supported Networks
EthereumPolygonBNB ChainOptimismBaseAvalancheArbitrumGnosisMoonbeamLineaHyperliquidBerachainMonadScrollPlasmaX Layer