payment_queryInfo
Description
Returns fee and weight information for a signed extrinsic without submitting it. Supports planning fee buffers and offline signing workflows.
Parameters
Position | Type | Description |
---|---|---|
0 | string | Signed extrinsic hex |
1 (optional) | string | Block hash to evaluate against |
Response Fields
Field | Type | Description |
---|---|---|
weight.ref_time | number | Estimated execution time weight |
weight.proof_size | number | Proof size weight |
class | string | normal , operational , or mandatory |
partialFee | string | Estimated partial fee in plancks |
Sample Request & Response
{
"jsonrpc": "2.0",
"method": "payment_queryInfo",
"params": ["0x2523053d0002500200…63155"],
"id": 99
}
{
"jsonrpc": "2.0",
"id": 99,
"result": {
"weight": { "ref_time": 3636401000, "proof_size": 18750 },
"class": "normal",
"partialFee": "0"
}
}
note
A zero partialFee
indicates the runtime uses fee subsidies (for example, dApp staking payouts). Standard transfers will return positive fees.
Code Examples
JavaScript (polkadot.js)
const tx = api.tx.balances.transferKeepAlive(dest, amount);
const info = await api.rpc.payment.queryInfo(tx.toHex());
console.log(info.toHuman());
Python (py-substrate-interface)
extrinsic_hex = substrate.create_signed_extrinsic(call=call, keypair=keypair).to_hex()
info = substrate.rpc_request('payment_queryInfo', [extrinsic_hex])['result']
print(info)