rpc_methods - Asset Hub RPC Method
List all available RPC methods on Asset Hub. Essential for API discovery, capability detection, and building dynamic tooling for Substrate-based chains.
Returns a list of all RPC methods exposed by the Asset Hub node. This is the definitive way to discover what methods are available on a given endpoint, including both standard Substrate methods and any custom chain-specific extensions.
Why Asset Hub? Build on Polkadot's system parachain managing $4.5B+ in DOT tokens, native USDC/USDT, and NFTs with 50-90% lower fees than Relay Chain, fee payment in any supported asset, 1.5M+ accounts migrated, and trustless Ethereum bridge access.
When to Use This Method
rpc_methods is essential for asset issuers, stablecoin integrators, and teams requiring low-cost token management on Polkadot:
- API Discovery -- Enumerate all available RPC methods to understand the full capabilities of a Asset Hub node
- Capability Detection -- Check whether a specific method (e.g.,
author_submitExtrinsic,state_call) is available before calling it - Compatibility Testing -- Verify that an endpoint supports the methods your application requires for native stablecoin transfers (USDC, USDT), DOT staking and governance, and cross-chain asset management via XCM
- Tooling and Documentation -- Auto-generate API references or client SDKs from the available method list
Code Examples
Common Use Cases
1. Endpoint Capability Validation
Check whether a Asset Hub endpoint supports all methods your application needs:
async function validateEndpoint(endpoint, requiredMethods) {
const response = await fetch(endpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'rpc_methods',
params: [],
id: 1
})
});
const { result } = await response.json();
const available = new Set(result.methods);
const missing = requiredMethods.filter((m) => !available.has(m));
if (missing.length > 0) {
console.error('Missing required methods:', missing);
return false;
}
console.log('Endpoint supports all required methods');
return true;
}
// Usage
await validateEndpoint('https://asset-hub-polkadot-rpc.n.dwellir.com', [
'state_getStorage',
'state_call',
'author_submitExtrinsic',
'payment_queryInfo'
]);2. Method Category Breakdown
Organize available methods by their RPC namespace:
async function getMethodsByCategory(api) {
const methods = await api.rpc.rpc.methods();
const categories = {};
methods.methods.forEach((method) => {
const name = method.toString();
const category = name.split('_')[0];
categories[category] = categories[category] || [];
categories[category].push(name);
});
for (const [category, methodList] of Object.entries(categories)) {
console.log(`\n${category} (${methodList.length} methods):`);
methodList.forEach((m) => console.log(` - ${m}`));
}
return categories;
}3. Compare Endpoints
Detect differences between two Asset Hub endpoints:
async function compareEndpoints(endpoint1, endpoint2) {
const fetchMethods = async (url) => {
const res = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', method: 'rpc_methods', params: [], id: 1 })
});
const { result } = await res.json();
return new Set(result.methods);
};
const [methods1, methods2] = await Promise.all([
fetchMethods(endpoint1),
fetchMethods(endpoint2)
]);
const onlyIn1 = [...methods1].filter((m) => !methods2.has(m));
const onlyIn2 = [...methods2].filter((m) => !methods1.has(m));
if (onlyIn1.length) console.log('Only in endpoint 1:', onlyIn1);
if (onlyIn2.length) console.log('Only in endpoint 2:', onlyIn2);
if (!onlyIn1.length && !onlyIn2.length) console.log('Endpoints have identical methods');
}Error Handling
Common errors and solutions:
| Error Code | Description | Solution |
|---|---|---|
| -32603 | Internal error | Node may be starting up -- retry after delay |
| HTTP 429 / -32029 | Rate limit exceeded | Cache the method list since it rarely changes at runtime and back off before retrying |
| Connection refused | Node unreachable | Verify the RPC endpoint URL and that the node is running |
Related Methods
system_chain-- Get the chain namesystem_name-- Get the node implementation namesystem_version-- Get the node implementation versionstate_getMetadata-- Get full runtime metadata including pallet and call definitions
beefy_getFinalizedHead
Get the BEEFY finalized block hash on Asset Hub. Bridge-optimized finality proofs for cross-chain communication and light client verification on Polkadot's system parachain managing $4.5B+ in DOT tokens, native USDC/USDT, and NFTs.
Astar RPC Guide
Production-ready JSON-RPC guide for Astar Network, covering endpoints, network specs, integration patterns, and troubleshooting for builders targeting Polkadot parachain 2006.