v1

latestOpenAPI 3.1.02026-07-243035381.4 MB
Fee Estimation API

Estimate the fee for a XinFin transaction

2 credits per API call

Get an estimated gas price and the number of gas units needed for a XinFin transaction. The gas price is obtained from https://rpc.xinfin.network/gasPrice.

NOTE: The estimated gas price is returned in wei. However, when making the transaction itself and providing the custom fee, you have to provide the gas price in Gwei. Make sure to convert the estimated gas price from wei to Gwei before submitting your transaction.

post/v3/xdc/gas

Request body

fromstring required

Sender address.

tostring required

Blockchain address to send assets

amountstring required

Amount to be sent in XDC.

Example request

{
  "from": "xdcfb99f8ae9b70a0c8cd96ae665bbaf85a7e01a2ef",
  "to": "xdc687422eEA2cB73B5d3e242bA5456b782919AFc85",
  "amount": "100000"
}

Response

OK

gasPricestring required

The estimated price for one gas unit (in wei)

gasLimitnumber required

The number of the gas units needed to process the transaction at the estimated gas price

Example response

{
  "gasPrice": "10000000000"
}