payment_queryInfo
note
Shared public RPC nodes typically do not allow submitting transactions; this method is read-only but requires a valid extrinsic payload (a signed extrinsic hex).
Returns fee information for an encoded extrinsic. Examples below show how to build an extrinsic with polkadot.js and then query.
- cURL
- Polkadot.js
# Replace 0x... with an actual encoded extrinsic hex
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"payment_queryInfo","params":["0x..."],"id":1}'
import { ApiPromise, WsProvider, Keyring } from '@polkadot/api';
const api = await ApiPromise.create({ provider: new WsProvider('wss://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY') });
const alice = new Keyring({ type: 'sr25519' }).addFromUri('//Alice');
// Build a dummy extrinsic that exists in the runtime (example: balances.transfer if available)
// If pallet Balances is not present, use a pallet from the Bittensor runtime (e.g., subtensor) instead.
const call = api.tx.system.remark('0x00');
const signed = await call.signAsync(alice, { nonce: 0 });
const info = await api.rpc.payment.queryInfo(signed.toHex());
console.log(info.toHuman());
await api.disconnect();