estimateFee - Dogecoin
Example code for the estimateFee WebSocket method. Complete guide on how to use the estimateFee WebSocket method in the GetBlock Web3 documentation.
Returns the backend fee estimate for one or more confirmation targets. Supplying the transaction's size returns the estimated total fee alongside the per-unit rate.
Parameters
blocks
array
Yes
Confirmation targets in blocks, one estimate returned per entry
specific
object
No
Chain-specific options: conservative for smart fee mode, txsize in bytes
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": 225
}
}
}Response
Results are returned in the same order as the requested blocks targets.
Response Fields
feePerTx
string
Estimated total fee in koinu for a transaction of the supplied txsize
feePerUnit
string
Estimated fee rate in koinu per kilobyte, not per byte
Use Cases
Fee Selection: Choose a rate matching the confirmation speed a payment needs
Cost Preview: Show the user the fee before signing
Tiered Options: Offer standard and economy targets from one call
Batch Planning: Size a consolidation against the current rate
Error Handling
error
Invalid params
The blocks array is missing or malformed
403 / RBAC: access denied
Access denied
The GetBlock access token is missing or incorrect
Last updated
Was this helpful?