payment_queryInfo - JSON-RPC Method
Returns the fee information for the given signed extrinsic.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
extrinsic | string | Yes | SCALE-encoded signed extrinsic in hex |
cURL Example
curl -X POST https://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id":1,
"method":"payment_queryInfo",
"params":["0x<signed_extrinsic_hex>"]
}'
Tip: First compute a fully signed extrinsic (matching the nonce from
system_accountNextIndex
). Then pass the same hex here to get the final fee.
JavaScript (polkadot.js)
import { ApiPromise, WsProvider } from '@polkadot/api';
async function estimate(exHex: string) {
const api = await ApiPromise.create({ provider: new WsProvider('wss://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY') });
const info = await api.rpc.payment.queryInfo(exHex);
console.log('PartialFee:', info.partialFee.toString());
await api.disconnect();
}
Returns
ExtrinsicFeeDetails
including weight
and partialFee
.
Notes
- Provide the exact signed payload you intend to broadcast; otherwise the result may differ.
- Combine with
payment_queryFeeDetails
for a breakdown of fee components.