Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

payment_queryInfo - Kusama

Example code for the payment_queryInfo JSON-RPC method. Complete guide on how to use payment_queryInfo JSON-RPC in GetBlock Web3 documentation.

Returns the fee information for a signed extrinsic without submitting it: its dispatch weight, class, and the estimated partial fee. Use it to show a fee estimate before broadcasting.

Available over both the JSON-RPC (HTTP) and WebSocket interfaces.

Parameters

Parameter
Type
Required
Description

extrinsic

string

Yes

Hex-encoded signed extrinsic

at

string

Optional

Block hash; omit for the latest

Request

curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "method": "payment_queryInfo",
    "params": [
    "0x4d028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d..."
]
}'
example.js
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    id: 'getblock.io',
    method: 'payment_queryInfo',
    params: [
    "0x4d028400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d..."
]
}, { headers: { 'Content-Type': 'application/json' } });

console.log(response.data.result);

Response

Response Fields

Field
Type
Description

weight

object

Dispatch weight (refTime and proofSize)

class

string

Dispatch class (normal, operational, mandatory)

partialFee

string

Estimated fee in Planck (10^-12 KSM)

Use Cases

  • Fee Preview: Show an estimated fee before signing

  • Budgeting: Size a user's balance against the fee

  • Weight Analysis: Read dispatch weight for a call

Error Handling

Error
Message
Description

-32603 / Internal error

Bad extrinsic

The extrinsic could not be decoded

403 / RBAC: access denied

Access denied

The GetBlock access token is missing or incorrect

Last updated

Was this helpful?