GetEstimatedFee()

Summary

Route
Type
Example

Monitor/GetEstimatedFee

POST

http://176.113.80.7:62000/api/monitor/getestimatedfee

Description

Get transaction fee.

Request

Request Structure

{

// Parameters common for all requests

// Wallet address
  "networkAlias": string, // Mainnet or Testnet
  "transactionSize": <size>,
  "trType": a // (a = 0 - normal, 1 - token transfer, 2 - contract deploy, 3 - contract execute)

}

Request Parameters

int: transactionSize - Transaction size in bytes

int: trType- Transaction type. 0 - normal, 1 - token transfer, 2 - contract deploy, 3 - contract execute

Response

JSON output depends on the request type and its success.

If there’s an error, request returns to the node basic Result:

  • Success: False

  • Message:

If successful, requested information is returned.

Response Structure

{
   "fee": "decimal", // amount of fee
   "success":"bool", // Shows if request was Succes or False Boolean Value 
   "message":"String" // Shows if a problem occurred with request in String Value
}

Example Code

Python

import requests
import json
def gettransactioninfo():
    url =  'http://176.113.80.7:62000/api/monitor/getestimatedfee'
    headers = {
        'Content-type': 'application/json'
        , 'Accept': 'application/json'
        , 'Content-Encoding': 'utf-8'
        }
    data = {
        "networkAlias":"Mainnet",
        "transactionSize":500, #transaction size 500 bytes
        "trType": 1 #  #transaction type 1 - token transfer
        }
    answer = requests.post(url, data=json.dumps(data), headers=headers)
    response = answer.json()
    print(response)
gettransactioninfo()

Last updated