API Principal
Activar direccion
Activar una direccion TRON inactiva en la blockchain
POST
/
api
/
v1
/
energy
/
activate
Activar direccion
curl --request POST \
--url https://api.example.com/api/v1/energy/activate \
--header 'Content-Type: application/json' \
--data '
{
"target_address": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/energy/activate"
payload = { "target_address": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target_address: '<string>'})
};
fetch('https://api.example.com/api/v1/energy/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/energy/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_address' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/energy/activate"
payload := strings.NewReader("{\n \"target_address\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/energy/activate")
.header("Content-Type", "application/json")
.body("{\n \"target_address\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/energy/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_address\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "<string>",
"txid": "<string>",
"cost_trx": "<string>",
"id": 123
}Activar direccion
Activa una direccion TRON que nunca ha recibido ninguna transaccion. Es necesario antes de que la direccion pueda recibir tokens. Costo: 1.2 TRX (se deduce de tu saldo)Cuerpo de la solicitud
string
requerido
Direccion TRON a activar (formato T…)
Respuesta
boolean
Si la activación tuvo éxito
string
completed — enviamos la activación; already_activated — la dirección ya estaba activa en la redstring
Hash de la transacción de activación
string
TRX cobrados por la activación (0 si la dirección ya estaba activa)
number
Identificador del registro de activación
Ejemplo
curl -X POST https://api.tronrental.com/v1/energy/activate \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"target_address": "TNewInactiveAddress..."}'
Response
{
"success": true,
"status": "completed",
"txid": "a1b2c3d4e5f6...",
"cost_trx": "1.2",
"id": 12345
}
⌘I
Activar direccion
curl --request POST \
--url https://api.example.com/api/v1/energy/activate \
--header 'Content-Type: application/json' \
--data '
{
"target_address": "<string>"
}
'import requests
url = "https://api.example.com/api/v1/energy/activate"
payload = { "target_address": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({target_address: '<string>'})
};
fetch('https://api.example.com/api/v1/energy/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/energy/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target_address' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/energy/activate"
payload := strings.NewReader("{\n \"target_address\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/energy/activate")
.header("Content-Type", "application/json")
.body("{\n \"target_address\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/energy/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_address\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "<string>",
"txid": "<string>",
"cost_trx": "<string>",
"id": 123
}