payment_queryFeeDetails
Description#
Returns a detailed fee breakdown, including base fee, length fee, adjusted weight fee, and inclusion tip when applicable.
Parameters#
| Position | Type | Description |
|---|---|---|
| 0 | string | Signed extrinsic hex |
| 1 (optional) | string | Block hash |
Response Fields#
| Field | Description |
|---|---|
inclusionFee | Object containing baseFee, lenFee, adjustedWeightFee |
tip | Optional tip included with the extrinsic |
Sample Request & Response#
{
"jsonrpc": "2.0",
"method": "payment_queryFeeDetails",
"params": ["0x2523053d0002500200…63155"],
"id": 100
}
{
"jsonrpc": "2.0",
"id": 100,
"result": {
"inclusionFee": null
}
}
For subsidized operations (such as staking payouts), the runtime may waive inclusion fees, resulting in null. Regular transfers will return the full fee breakdown.
Code Examples#
- Python
- JavaScript
fee_details = substrate.rpc_request('payment_queryFeeDetails', [extrinsic_hex])['result']
print(fee_details)
const info = await api.rpc.payment.queryFeeDetails(tx.toHex());
console.log(info.toHuman());