rpc_methods - Hydration RPC Method
List all available RPC methods on Hydration. Essential for API discovery, capability detection, and building dynamic tooling for Substrate-based chains.
Returns a list of all RPC methods exposed by the Hydration 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 Hydration? Build on Polkadot's leading DEX with $200M+ TVL, Omnipool AMM, and native HOLLAR stablecoin with Omnipool with reduced slippage, permissioned listings, 3M DOT DAO allocation, and 200%+ APR farm yields.
When to Use This Method
rpc_methods is essential for DeFi developers, liquidity providers, and DAOs requiring capital-efficient trading:
- API Discovery -- Enumerate all available RPC methods to understand the full capabilities of a Hydration 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 single-sided liquidity provision, cross-chain trading (SOL, KSM, tBTC), and HOLLAR decentralized stablecoin
- 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 Hydration 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://api-hydradx.dwellir.com/YOUR_API_KEY', [
'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 Hydration 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 Hydration. Bridge-optimized finality proofs for cross-chain communication and light client verification on Polkadot's leading DEX with $200M+ TVL, Omnipool AMM, and native HOLLAR stablecoin.
Hyperliquid - High-Performance Trading Infrastructure
Complete guide to Hyperliquid integration with Dwellir. Access HyperEVM JSON-RPC endpoints and L1 gRPC streaming for order books and trading data.