For the complete documentation index, see llms.txt. This page is also available as Markdown.

Copy of price-estimate

Example code for the price-estimate JSON RPC method. Сomplete guide on how to use price-estimate JSON RPC in GetBlock Web3 documentation.

This get a real-time price estimate for Energy delegation before placing an order.

Body Parameter

Parameter

Type

Required

Description

resourceType

string

Yes

"energy"

volume

integer

Yes

Energy amount: 30,000 — 5,000,000

duration

string

Yes

"1h", "1d", "3d", "7d", "14d"

Request Sample

curl -X POST https://api.getblock.io/tron-energy/api/price-estimate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "resourceType": "energy",
    "volume": 50000,
    "duration": "1h"
  }
'
import axios from 'axios';
const data = JSON.stringify({
    "resourceType": "energy",
    "volume": 50000,
    "duration": "1h"
  }
);

const config = {
    method: 'post',
    url: 'https://api.getblock.io/tron-energy/api/price-estimate ',
    headers: {
        'Content-Type': 'application/json',
        'Authorization: Bearer YOUR_API_KEY'
    },
    data: data
};
axios(config)
    .then(response => console.log(JSON.stringify(response.data)))
    .catch(error => console.log(error));

Response Sample

Last updated

Was this helpful?