Batch Query Transaction Average Fees

Batch Query average blockchain fee within latest N blocks.

Request

VIEW

 POST /v1/sofa/wallets/WALLET_ID/autofees

Post Body

Field Type Note Description
block_nums array required, max 5 entries, each entry is range 1~100 Batch query the average blockchain fee in the last N blocks

Response Body

Field Type Description
auto_fees array Result of the inquiry
block_num int Inquiry block number
auto_fee string Mining fee denominated in the smallest cryptocurrency unit

Error Code

HTTP Code Error Code Error Message Description
403 - Forbidden. Invalid wallet ID - No wallet ID found
403 - Forbidden. Header not found - Missing X-API-CODE, X-CHECKSUM header or query param t
403 - Forbidden. Invalid timestamp - The timestamp t is not in the valid time range
403 - Forbidden. Invalid checksum - The request is considered a replay request
403 - Forbidden. Invalid API code - X-API-CODE header contains invalid API code
403 - Invalid API code for wallet {WALLET_ID} - The API code mismatched
403 - Forbidden. Checksum unmatch - X-CHECKSUM header contains wrong checksum
403 - Forbidden. Call too frequently ({THROTTLING_COUNT} calls/minute) - Send requests too frequently
403 385 API Secret not valid - Invalid API code permissions
400 112 Invalid parameter - The block_num is out of range

Sample Request

API

/v1/sofa/wallets/854714/autofees

Post Body

{
  "block_nums": [
    1,
    5,
    10
  ]
}

Response Body

{
  "auto_fees": [
    {
      "auto_fee": "49000000000",
      "block_num": 1
    },
    {
      "auto_fee": "49000000000",
      "block_num": 5
    },
    {
      "auto_fee": "38000000000",
      "block_num": 10
    }
  ]
}

Sample cURL Command

curl -X POST -H "Content-Type: application/json" -d '{"block_nums":[1,5,10]}' \
http://localhost:8889/v1/mock/wallets/{WALLET_ID}/autofees