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

estimateFee - Dash

Example code for the estimateFee WebSocket method. Complete guide on how to use the estimateFee WebSocket method in the GetBlock Web3 documentation.

Returns fee-rate estimates for one or more confirmation-block targets over WebSocket.

Parameters

Parameter
Type
Required
Description

blocks

array

Yes

Array of confirmation targets, e.g. [1, 6, 12]

Message

wscat -c wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>

# then send:
{
    "id": "getblock.io",
    "method": "estimateFee",
    "params": {
        "blocks": [
            1,
            6,
            12
        ],
        "specific": {
            "conservative": true,
            "txsize": 1278
        }
    }
}

Response

Response Fields

Field
Type
Description

feePerTx

string

Estimated total fee in duffs for a transaction of the supplied txsize

feePerUnit

string

Estimated fee rate in duffs per kilobyte, not per byte

Results are returned in the same order as the requested blocks targets.

Use Cases

  • Fee Selection: Fetch several targets at once

  • Wallets: Offer fee tiers

  • Batching: Pick economical fees

Error Handling

Error
Message
Description

error

Bad request

The targets are invalid

403 / RBAC: access denied

Access denied

The GetBlock access token is missing or incorrect

Last updated

Was this helpful?