POST /apiv2/time/delete
Eliminar una dirección TRON del Modo Host y reclamar todas las delegaciones de energía activas.
Resumen
El punto final de eliminación de tiempo elimina permanentemente una dirección TRON de la administración del Modo Host, recuperando inmediatamente cualquier delegación de energía activa y deteniendo todos los servicios de administración de energía automatizados. Esta acción es irreversible para el ciclo de facturación actual, pero la dirección se puede volver a agregar más tarde si es necesario.
URL del Punto Final
POST https://netts.io/apiv2/time/delete
Autenticación
Este punto final utiliza autenticación mediante cuerpo JSON (no encabezados). Su clave API y la dirección de destino se proporcionan en el cuerpo de la solicitud.
Flujo de Autenticación
- API Key Validation: System verifies the API key exists and is active
- IP Whitelist Check: Request IP must match configured whitelist
- Ownership Verification: API key must own the specified address
- Permission Check: Account must have deletion permissions enabled
Encabezados de la Petición
Header | Required | Description |
---|---|---|
Content-Type | Yes | application/json |
Cuerpo de la solicitud
{
"api_key": "your_api_key",
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}
Parámetros
Parameter | Type | Required | Validation | Description |
---|---|---|---|---|
api_key | string | Yes | Must exist in system | Your API key for authentication and billing |
address | string | Yes | TRC-20 format | TRON address to remove from Host Mode (must start with 'T' and be 34 characters) |
Validación de Parámetros
api_key:
- Must be a valid 32-character hexadecimal string
- Must be associated with an active account
- Must have ownership of the specified address
- Account must not be suspended or restricted
address:
- Must match TRC-20 format
^T[1-9A-HJ-NP-Za-km-z]{33}$
- Must be currently in Host Mode under your account
- Cannot be deleted if it has pending transactions
- Cannot be deleted during active delegation cycle (wait for cycle completion)
- Must match TRC-20 format
IP Address:
- Your request IP must be in the whitelist associated with your API key
- Maximum 5 IP addresses per API key
- IPv4 and IPv6 supported
Ejemplos de Solicitudes
cURL
curl -X POST https://netts.io/apiv2/time/delete \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY_HERE",
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
}'
Python
import requests
import json
from typing import Dict, Optional
def delete_from_host_mode(api_key: str, address: str) -> Dict:
"""
Remove a TRON address from Host Mode.
Args:
api_key: Your API authentication key
address: TRON address to remove
Returns:
API response dictionary
"""
url = "https://netts.io/apiv2/time/delete"
# Validate address format
if not address.startswith('T') or len(address) != 34:
raise ValueError(f"Invalid TRON address format: {address}")
data = {
"api_key": api_key,
"address": address
}
try:
response = requests.post(url, json=data, verify=True, timeout=30)
response.raise_for_status()
result = response.json()
if result['code'] == 0:
print(f"✅ Successfully removed from Host Mode: {result['data']['address']}")
print(f"Energy reclaimed: {result['data'].get('energy_reclaimed', 0)}")
print(f"Cycles remaining: {result['data'].get('cycles_remaining', 0)}")
else:
print(f"❌ Error: {result['msg']}")
return result
except requests.exceptions.RequestException as e:
print(f"❌ Request failed: {str(e)}")
raise
except json.JSONDecodeError as e:
print(f"❌ Invalid JSON response: {str(e)}")
raise
# Example usage
if __name__ == "__main__":
API_KEY = "YOUR_API_KEY_HERE"
ADDRESS = "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE"
result = delete_from_host_mode(API_KEY, ADDRESS)
Node.js
const axios = require('axios');
/**
* Remove a TRON address from Host Mode
* @param {string} apiKey - Your API authentication key
* @param {string} address - TRON address to remove
* @returns {Promise<Object>} API response
*/
async function deleteFromHostMode(apiKey, address) {
const url = 'https://netts.io/apiv2/time/delete';
// Validate address format
if (!address.startsWith('T') || address.length !== 34) {
throw new Error(`Invalid TRON address format: ${address}`);
}
const data = {
api_key: apiKey,
address: address
};
try {
const response = await axios.post(url, data, {
headers: {
'Content-Type': 'application/json'
},
timeout: 30000
});
const result = response.data;
if (result.code === 0) {
console.log(`✅ Successfully removed from Host Mode: ${result.data.address}`);
console.log(`Energy reclaimed: ${result.data.energy_reclaimed || 0}`);
console.log(`Cycles remaining: ${result.data.cycles_remaining || 0}`);
} else {
console.error(`❌ Error: ${result.msg}`);
}
return result;
} catch (error) {
if (error.response) {
console.error(`❌ API Error: ${error.response.status} - ${error.response.data?.msg || error.message}`);
} else if (error.request) {
console.error('❌ No response from server');
} else {
console.error(`❌ Request failed: ${error.message}`);
}
throw error;
}
}
// Example usage
(async () => {
const API_KEY = 'YOUR_API_KEY_HERE';
const ADDRESS = 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE';
try {
const result = await deleteFromHostMode(API_KEY, ADDRESS);
console.log('Result:', result);
} catch (error) {
console.error('Failed to delete address:', error.message);
}
})();
PHP
<?php
/**
* Remove a TRON address from Host Mode
*
* @param string $apiKey Your API authentication key
* @param string $address TRON address to remove
* @return array API response
*/
function deleteFromHostMode($apiKey, $address) {
$url = 'https://netts.io/apiv2/time/delete';
// Validate address format
if (!preg_match('/^T[1-9A-HJ-NP-Za-km-z]{33}$/', $address)) {
throw new InvalidArgumentException("Invalid TRON address format: $address");
}
$data = [
'api_key' => $apiKey,
'address' => $address
];
$options = [
'http' => [
'header' => "Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data),
'timeout' => 30
]
];
$context = stream_context_create($options);
$response = @file_get_contents($url, false, $context);
if ($response === false) {
$error = error_get_last();
throw new RuntimeException('Request failed: ' . $error['message']);
}
$result = json_decode($response, true);
if ($result['code'] == 0) {
echo "✅ Successfully removed from Host Mode: {$result['data']['address']}\n";
echo "Energy reclaimed: " . ($result['data']['energy_reclaimed'] ?? 0) . "\n";
echo "Cycles remaining: " . ($result['data']['cycles_remaining'] ?? 0) . "\n";
} else {
echo "❌ Error: {$result['msg']}\n";
}
return $result;
}
// Example usage
$API_KEY = 'YOUR_API_KEY_HERE';
$ADDRESS = 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE';
try {
$result = deleteFromHostMode($API_KEY, $ADDRESS);
print_r($result);
} catch (Exception $e) {
echo "Failed to delete address: " . $e->getMessage() . "\n";
}
?>
Respuesta
Respuesta exitosa (200 OK)
{
"code": 0,
"msg": "Address successfully removed from Host Mode",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"status": "removed",
"energy_reclaimed": 131000,
"cycles_remaining": 0,
"timestamp": 1699528800,
"refund_amount": 0,
"transaction_hash": "f8b3c2a1d4e6957b8f9a0c3e5d7b9a1c3e5f7a9b1d3f5b7c9e1a3d5f7b9c1e3f5"
}
}
Campos de Respuesta
Field | Type | Description |
---|---|---|
code | integer | Status code (0 for success, -1 for error) |
msg | string | Human-readable status message |
data | object | Response data object |
data.address | string | The TRON address that was removed |
data.status | string | Current status ("removed") |
data.energy_reclaimed | integer | Amount of energy reclaimed from delegations |
data.cycles_remaining | integer | Number of unused cycles (always 0 after deletion) |
data.timestamp | integer | Unix timestamp of the deletion |
data.refund_amount | integer | TRX amount refunded for unused cycles (if applicable) |
data.transaction_hash | string | TRON blockchain transaction hash for the reclaim operation |
Respuestas de Error
Error de Autenticación (401)
{
"code": -1,
"msg": "Invalid API key",
"data": null
}
Causes:
- Invalid or expired API key
- API key not found in system
- Account suspended or terminated
Resolution:
- Verify API key is correct
- Check account status in dashboard
- Contact support if key should be valid
Dirección no encontrada (404)
{
"code": -1,
"msg": "Address not found in Host Mode",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"suggestion": "Use /time/add to add this address first"
}
}
Causes:
- Address was never added to Host Mode
- Address already deleted
- Address belongs to different API key
Resolution:
- Verify address is in Host Mode using
/time/status
- Check if address was already deleted
- Ensure you're using correct API key
Formato de Dirección No Válido (400)
{
"code": -1,
"msg": "Invalid TRON address format",
"data": {
"address": "invalid_address",
"format": "Address must start with 'T' and be 34 characters long"
}
}
Causes:
- Address doesn't match TRC-20 format
- Address contains invalid characters
- Address wrong length
Resolution:
- Verify address starts with 'T'
- Ensure address is exactly 34 characters
- Check for typos or copy/paste errors
Error de Delegación Activa (409)
{
"code": -1,
"msg": "Cannot delete address with active delegation",
"data": {
"address": "TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE",
"active_until": 1699532400,
"retry_after": 3600
}
}
Causes:
- Address has active energy delegation
- Delegation cycle not yet complete
- Pending transactions in progress
Resolution:
- Wait for current delegation cycle to complete
- Retry after the specified time
- Use
/time/stop
to pause delegations first
IP no incluida en la lista blanca (403)
{
"code": -1,
"msg": "IP address not whitelisted",
"data": {
"ip": "192.168.1.100",
"suggestion": "Add this IP to whitelist in dashboard"
}
}
Causes:
- Request IP not in API key whitelist
- IP address changed since configuration
- Using proxy or VPN
Resolution:
- Add IP to whitelist in dashboard
- Verify not using proxy/VPN
- Contact support to update whitelist
Permisos Insuficientes (403)
{
"code": -1,
"msg": "Insufficient permissions for this operation",
"data": {
"required_permission": "delete_addresses",
"your_permissions": ["read_only"]
}
}
Causes:
- API key has read-only permissions
- Delete operations disabled for account
- Sub-account with limited permissions
Resolution:
- Request permission upgrade from account owner
- Use master API key instead of sub-account key
- Contact support to enable delete permissions
Límites de Tasa
Period | Limit | Description |
---|---|---|
1 minute | 6 requests | Maximum 6 requests per minute per API key |
1 hour | 100 requests | Maximum 100 requests per hour per API key |
1 day | 1000 requests | Maximum 1000 requests per day per API key |
Encabezados de Límite de Tasa
X-RateLimit-Limit-Minute: 6
X-RateLimit-Remaining-Minute: 5
X-RateLimit-Reset-Minute: 1699528860
X-RateLimit-Limit-Hour: 100
X-RateLimit-Remaining-Hour: 98
X-RateLimit-Reset-Hour: 1699532400
X-RateLimit-Limit-Day: 1000
X-RateLimit-Remaining-Day: 995
X-RateLimit-Reset-Day: 1699574400
Respuesta de Límite de Tasa Excedido (429)
{
"code": -1,
"msg": "API rate limit exceeded",
"data": {
"retry_after": 45,
"limit": "6 per minute",
"reset_at": 1699528860
}
}
Qué sucede cuando se elimina
Acciones Inmediatas
Proceso de Recuperación de Energía
- All active energy delegations are immediately reclaimed
- Energy returns to the main pool within 1-2 blocks
- Delegation records are marked as terminated
Actualizaciones de la Base de Datos
- Address removed from Host Mode registry
- All automation schedules cancelled
- Historical data retained for 30 days
Operaciones de Blockchain
- Undelegate transaction submitted to TRON network
- Transaction typically confirms within 3 seconds
- Energy becomes available for other addresses
Consideraciones de Tiempo
- Instant Removal: Address removed from Host Mode immediately
- Energy Reclaim: Takes 1-2 TRON blocks (3-6 seconds)
- Database Cleanup: Background process within 5 minutes
- Refund Processing: If applicable, processed within 1 hour
Impacto en su Cuenta
- Cycles: Any remaining cycles are forfeited (no refund)
- Energy Pool: Reclaimed energy returns to available pool
- Billing: No further charges for this address
- Re-addition: Address can be added again immediately
Impacto del Modo Anfitrión
Antes de la eliminación
- Address receives automatic 131,000 energy every 24 hours
- Energy delegations managed automatically
- Continuous monitoring and optimization
- Automatic renewal based on usage
Después de la eliminación
- No more automatic energy delegations
- Address operates with its own resources only
- Must manually manage energy needs
- Can be re-added to Host Mode at any time
Consideraciones de Seguridad
Seguridad de Autenticación
- API Key Storage: Never expose API keys in client-side code
- HTTPS Only: All requests must use HTTPS
- IP Whitelist: Configure IP whitelist for production use
- Key Rotation: Rotate API keys regularly
Comprobaciones de Validación
Validación de la Clave API
- Key exists and is active
- Account has sufficient permissions
- Not exceeded rate limits
Titularidad de la Dirección
- Address belongs to API key owner
- Not locked or restricted
- No pending operations
Integridad de la Solicitud
- Valid JSON format
- Required fields present
- No SQL injection attempts
- No XSS payloads
Registro de Auditoría
Todas las operaciones de eliminación se registran con:
- Timestamp
- API key used
- IP address
- Address deleted
- Energy reclaimed
- Transaction hash
Arquitectura Técnica
Componentes del Servicio
Puerta de enlace API
- Request validation and routing
- Rate limiting enforcement
- IP whitelist checking
Servicio de Autenticación
- API key validation
- Permission checking
- Account status verification
Administrador del Modo Anfitrión
- Address registry management
- Delegation scheduling
- Resource allocation
Servicio Blockchain
- TRON network interaction
- Transaction submission
- Confirmation monitoring
Capa de Base de Datos
- PostgreSQL for persistent data
- Redis for caching and rate limits
- Audit log storage
Flujo de la Petición
- Client sends POST request with API key and address
- API Gateway validates request format and rate limits
- Authentication Service verifies API key and permissions
- Host Mode Manager checks address status
- Blockchain Service initiates energy reclaim
- Database updated with removal record
- Response sent to client with transaction details
Puntos Finales Relacionados
- POST /apiv2/time/add - Add address to Host Mode
- "POST /apiv2/time/stop" - Temporarily stop delegations
- "POST /apiv2/time/status" - Check current status
- "POST /apiv2/time/order" - Purchase additional cycles
- POST /apiv2/time/infinitystart - Enable unlimited cycles
Mejores Prácticas
Cuándo eliminar
- Permanent Removal: When you no longer need energy for an address
- Account Cleanup: Removing unused or old addresses
- Cost Optimization: Stopping charges for inactive addresses
- Security: Removing compromised addresses
Antes de Eliminar
- Check Active Transactions: Ensure no pending operations
- Verify Energy Usage: Confirm address doesn't need energy
- Document Transaction Hash: Save the reclaim transaction hash
- Consider Alternatives: Maybe
/time/stop
is sufficient
Después de Eliminar
- Verify Removal: Check status with
/time/status
- Monitor Transaction: Confirm blockchain transaction
- Update Records: Update your internal systems
- Plan Re-addition: If temporary, schedule when to re-add
Solución de problemas
Problemas Comunes
"Dirección no encontrada en modo Host"
Problema: Intentar eliminar una dirección que no está en Modo Host
Solutions:
- Verify address with
/time/status
endpoint - Check if already deleted
- Ensure using correct API key
- Verify address format is correct
"No se puede eliminar la dirección con delegación activa"
Problema: La dirección tiene energía actualmente delegada
Solutions:
- Wait for current cycle to complete (check
active_until
in response) - Use
/time/stop
first to pause delegations - Retry after the specified wait time
- Contact support if urgent removal needed
"Clave API no válida"
Problema: Clave API no reconocida o caducada
Solutions:
- Verify API key is correct (no extra spaces)
- Check account status in dashboard
- Ensure API key has delete permissions
- Generate new API key if needed
"Dirección IP no incluida en la lista blanca"
Problema: Solicitud proveniente de una IP no incluida en la lista blanca
Solutions:
- Add your IP to whitelist in dashboard
- Check if behind proxy or VPN
- Verify IP hasn't changed
- Use static IP for production
Obteniendo Ayuda
Si encuentra problemas no cubiertos aquí:
- Check Documentation: Review this guide and related endpoints
- API Status: Check https://status.netts.io for service status
- Support Ticket: Submit ticket with transaction details
- Emergency: Use emergency contact for critical issues
Notas
- Irreversible Action: Deletion removes all automation for the address
- No Partial Deletion: Address is either fully in Host Mode or completely removed
- Energy Reclaim: Reclaimed energy available immediately for other addresses
- Historical Data: Deletion history retained for audit purposes
- Re-addition Allowed: Same address can be added again with
/time/add
- No Refunds: Unused cycles are not refunded upon deletion
- Bulk Operations: For multiple deletions, implement client-side batching with rate limit compliance
- Webhook Support: Configure webhooks to receive deletion notifications
- API Versioning: This is v2 API; v1 is deprecated
- Maintenance Windows: Deletions may be delayed during maintenance (rare)