The networks API provides functionality for managing blockchain networks, their configurations, and Tron-specific operations.
Interactive Testing
Test the API in real time! Enter your API key and click "Test" buttons to send requests to https://cp-merch-dev.wsdemo.online/api
.
The networks API allows you to:
Returns list of all supported blockchain networks with their configurations.
Networks list retrieved
Returns information about a specific blockchain network.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
network | string | Да | Network slug (e.g., bitcoin, ethereum, tron, bsc) |
Network information retrieved
Invalid network slug
Returns the last processed block number for specified network.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
network | string | Да | Network slug |
Last block number retrieved
Stakes provided amount of TRX to obtain bandwidth or energy. Admin access only.
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
amount | string | Да | Amount of TRX to stake |
resource | string | Да | Resource type: BANDWIDTH or ENERGY |
TRX staked successfully
curl -X GET "https://cp-merch-dev.wsdemo.online/api/v1/networks" \
-H "X-Api-Key: YOUR_API_KEY"
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://cp-merch-dev.wsdemo.online/api/v1/networks", nil)
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Printf("Response: %s\n", body)
}
const getNetworks = async () => {
const response = await fetch('https://cp-merch-dev.wsdemo.online/api/v1/networks', {
headers: {
'X-Api-Key': 'YOUR_API_KEY'
}
});
const networks = await response.json();
console.log('Networks:', networks);
};
getNetworks();
import requests
headers = {
'X-Api-Key': 'YOUR_API_KEY'
}
response = requests.get('https://cp-merch-dev.wsdemo.online/api/v1/networks',
headers=headers)
if response.status_code == 200:
networks = response.json()
print(f"Found {len(networks)} networks")
else:
print(f"Error: {response.status_code}")
<?php
$apiKey = 'YOUR_API_KEY';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://cp-merch-dev.wsdemo.online/api/v1/networks');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Api-Key: ' . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$networks = json_decode($response, true);
echo "Found " . count($networks) . " networks\n";
}
?>