payment_queryFeeDetails
Description
Returns a detailed fee breakdown for a signed extrinsic, including baseFee
, lenFee
, and adjustedWeightFee
. Combine with payment_queryInfo
to present both total fee and components.
Parameters
Position | Type | Description |
---|---|---|
0 | string | Signed extrinsic hex |
1 (optional) | string | Block hash |
Example (HTTP)
curl -s https://api-acala.n.dwellir.com/YOUR_API_KEY \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":100,"method":"payment_queryFeeDetails","params":["0xSIGNED_EXTRINSIC_HEX"]}'
Sample Response
{
"jsonrpc": "2.0",
"id": 100,
"result": {
"inclusionFee": {
"baseFee": "0x...",
"lenFee": "0x...",
"adjustedWeightFee": "0x..."
},
"tip": null
}
}
Code Examples
- TypeScript (polkadot.js)
- Python (py-substrate-interface)
const details = await api.rpc.payment.queryFeeDetails(signedTx.toHex());
console.log(details.toHuman());
fee_details = substrate.rpc_request('payment_queryFeeDetails', [extrinsic_hex])['result']
print(fee_details)