curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": [],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "HyperEVM/v1.0.0"
}
Returns the current client version. This method provides information about the Ethereum client implementation and version running on the Hyperliquid EVM.
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": [],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "HyperEVM/v1.0.0"
}
const getClientVersion = async () => {
const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_API_KEY/evm', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'web3_clientVersion',
params: [],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Usage
const clientVersion = await getClientVersion();
console.log('Client version:', clientVersion); // "HyperEVM/v1.0.0"
// Parse version information
const [clientName, version] = clientVersion.split('/');
console.log('Client:', clientName); // "HyperEVM"
console.log('Version:', version); // "v1.0.0"
const checkClientCompatibility = async (minVersion) => {
const clientVersion = await getClientVersion();
// Extract version number (assuming format like "HyperEVM/v1.2.3")
const versionMatch = clientVersion.match(/v(\d+\.\d+\.\d+)/);
if (!versionMatch) {
console.warn('Could not parse client version:', clientVersion);
return false;
}
const currentVersion = versionMatch[1];
console.log(`Client version: ${currentVersion}, Required: ${minVersion}`);
// Simple version comparison (for production, use a proper semver library)
return currentVersion >= minVersion;
};
// Usage
const isCompatible = await checkClientCompatibility('1.0.0');
if (!isCompatible) {
console.error('Client version not supported');
}
Successful response with client version information
The response is of type object
.
Was this page helpful?