POST /apiv2/time/infinitystart
Включение бесконечного режима для адреса в Host Mode (неограниченные циклы).
URL эндпоинта
POST https://netts.io/apiv2/time/infinitystart
Заголовки запроса
Заголовок | Обязательный | Описание |
---|---|---|
Content-Type | Да | application/json |
X-API-KEY | Да | Ваш API ключ |
Тело запроса
json
{
"address": "TExampleAddress1234567890123456789"
}
Параметры запроса
Параметр | Тип | Обязательный | Описание |
---|---|---|---|
address | string | Да | TRC-20 адрес для включения infinity режима |
Примеры запросов
cURL
bash
curl -X POST https://netts.io/apiv2/time/infinitystart \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-d '{"address": "TExampleAddress1234567890123456789"}'
Python
python
import requests
url = "https://netts.io/apiv2/time/infinitystart"
headers = {"X-API-KEY": "your_api_key"}
data = {"address": "TExampleAddress1234567890123456789"}
response = requests.post(url, headers=headers, json=data)
result = response.json()
if response.status_code == 200:
print(f"Infinity режим включен для: {result['data']['address']}")
else:
print(f"Ошибка: {result.get('msg')}")
Node.js
javascript
const axios = require('axios');
const url = 'https://netts.io/apiv2/time/infinitystart';
const headers = {'X-API-KEY': 'your_api_key'};
const data = {address: 'TExampleAddress1234567890123456789'};
async function startInfinityMode() {
try {
const response = await axios.post(url, data, { headers });
console.log(`Infinity режим включен: ${response.data.data.address}`);
} catch (error) {
console.error('Error:', error.response.data.msg);
}
}
startInfinityMode();
PHP
php
<?php
$url = 'https://netts.io/apiv2/time/infinitystart';
$headers = ['Content-Type: application/json', 'X-API-KEY: your_api_key'];
$data = json_encode(['address' => 'TExampleAddress1234567890123456789']);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200) {
$result = json_decode($response, true);
echo "Infinity режим включен: " . $result['data']['address'] . "\n";
} else {
$error = json_decode($response, true);
echo "Ошибка: " . $error['msg'] . "\n";
}
?>
Ответ
Успешный ответ (200 OK)
json
{
"code": 0,
"msg": "Infinity mode started successfully",
"data": {
"address": "TExampleAddress1234567890123456789",
"mode": "infinity",
"started_at": "2025-08-16T10:45:20"
}
}
Параметры ответа
Параметр | Тип | Описание |
---|---|---|
address | string | TRC-20 адрес |
mode | string | Режим работы ("infinity") |
started_at | string | Время включения infinity режима |
Ошибки
Адрес не найден (404)
json
{
"code": -4,
"msg": "Address not found in Host Mode",
"data": null
}
Режим уже включен (409)
json
{
"code": -4,
"msg": "Infinity mode already active",
"data": null
}
Примечания
- Infinity режим обеспечивает неограниченную аренду энергии для адреса
- Стоимость списывается автоматически с вашего баланса
- Можно отключить через эндпоинт
/time/stop
- Убедитесь что у вас достаточный баланс для автоматических списаний