payment_queryInfo
Description
Returns fee and weight information for a signed extrinsic without submitting it. Use this to pre‑calculate costs and set safe fee buffers before calling author_submitExtrinsic
.
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 weight (time) |
weight.proof_size | number | Estimated proof size |
class | string | normal , operational , or mandatory |
partialFee | string | Estimated partial fee in plancks |
Example (HTTP)
curl -s https://api-acala.n.dwellir.com/YOUR_API_KEY \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":99,"method":"payment_queryInfo","params":["0xSIGNED_EXTRINSIC_HEX"]}'
Code Examples
- TypeScript (polkadot.js)
- Python (py-substrate-interface)
// Create a tx, sign offline or via keyring, then:
const info = await api.rpc.payment.queryInfo(signedTx.toHex());
console.log(info.toHuman());
extrinsic_hex = substrate.create_signed_extrinsic(call=call, keypair=keypair).to_hex()
info = substrate.rpc_request('payment_queryInfo', [extrinsic_hex])['result']
print(info)