With this system, you can create addresses on the TRON network and deposit and withdraw amount on TRX, TRC10 and TRC20 smart contract system.
First, you will need api_key and secret_key. These API keys located in your account. You are required it when
you want to use API key for interact with service.
Also you required to restrict API access to your own secure IP addresses. If you do not know your server's
IPaddress, you can run this command on your server.
curl 'https://tron24.top/api/'
First, get API key and secret key from panel and choose method's that you need.
Never share your API key/secret key to ANYONE.
API key and secret key will be something like this:
API Key: 4f3c12fa0a1d1ac8b026298b980f16b2 SECRET KEY: f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6For each request you must send two params in header, one of this is
api_key
and another is api_sign
you must create api_sign by hmac_hash sha256 on params that you will be sent!
par1=value1
and par2=value2
to API api_sign
string by secret_key
.
$post_encode = http_build_query([ 'par1'=>'value1', 'par2'=>'value2' ]); $s = hash_hmac('sha256', $post_encode, 'f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6', true); echo base64_encode($s); //g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=
var crypto = require('crypto'); var hash = crypto.createHmac('SHA256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").update("par1=value1&par2=value2").digest('base64');
import hashlib import hmac import base64 dataToBeSigned= bytes("par1=value1&par2=value2").encode('utf-8') portalKey = bytes("f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6").encode('utf-8') signature = base64.b64encode(hmac.new(portalKey, dataToBeSigned, digestmod=hashlib.sha256).digest())
require 'openssl' require "base64" hash = OpenSSL::HMAC.digest('sha256', "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6", "par1=value1&par2=value2") token = Base64.encode64(hash) token.delete("\n")
import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; public class ApiSecurityExample { public static void main(String[] args) { String portalKey = "f7d36fd7f60ab0bac12051e0c3240508585dba741e126669bfbc06e002b9df6ac4e457b6"; String dataToBeSigned= "par1=value1&par2=value2"; Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); SecretKeySpec secret_key = new SecretKeySpec(portalKey.getBytes(), "HmacSHA256"); sha256_HMAC.init(secret_key); String hash = Base64.encodeBase64String(sha256_HMAC.doFinal(dataToBeSigned.getBytes())); } }
At this level , you must have api_key
and api_sign
and params that you want to send
par1=value1&par2=value2
send params via post method to API and set api_key
and api_sign
in header .
CURL
curl -H "api_key:4f3c12fa0a1d1ac8b026298b980f16b2" -H "api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=" --data "par1=value1&par2=value2" https://tron24.top/api/ example
$_headers = [ 'api_key:4f3c12fa0a1d1ac8b026298b980f16b2', 'api_sign:g1seBV5gkv7n4EjIdzMjl+ntJ256kvIe2kulu2SfTPk=', ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $_headers); curl_setopt($ch, CURLOPT_URL, 'https://tron24.top/api/example'); curl_setopt($ch, CURLOPT_POSTFIELDS, 'par1=value1&par2=value2'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $result = curl_exec($ch); curl_close($ch); echo $result;
All response is json format .
Success Sample:
{ ... "success": true, "status": 200 }success will be true if everything is fine and status is same as a http status code.
{ "errors": { "auth": "INVALID_API_SIGN" }, "success": false, "status": 403 }
POST https://tron24.top/api/generate-address
Name | Type | Mandatory | Description |
label | string | no | set label for new assigned address like Hotwallet5 |
{ "address_id": 1781, "address": "TNg2MrAco9WBa62qPRdGuLdmZcxAbuxq1L", "label": "Hotwallet5", "success": true, "status": 200 }
POST https://tron24.top/api/withdraw
Name | Type | Mandatory | Description |
address_id | integer | yes | |
coin | string | yes | TRX , BTT , USDT |
to_address | string | yes | Receiver Address |
amount | float | yes | Please check have enough tron for fee |
{ "txid": "68f4a30a3cb48c9425d0619d977c881349fa3fd3e62f74aaa1c60d1c87c9ba6a", "success": true, "status": 200 }
POST https://tron24.top/api/get-address-by-id
Name | Type | Mandatory | Description |
address_id | integer | yes | address_id is unique that returned in generate address API |
{ "id": 1406, "address": "TKpCiG3yifm2QrMdMwpJLzjFUB1kbc8zPz", "label": "Hotwallet6", "address_id": 1406, "date": "2021-07-21T09:46:27+0200", "db_balance": { "TRX": "0.1", "BTT": "0.03", "USDT": 0 }, "success": true, "status": 200 }
POST https://tron24.top/api/get-address
Name | Type | Mandatory | Description |
address | string | yes | Tron address TKpCiG3yifm2QrMdMwpJLzjFUB1kbc8zPz |
{ "id": 1406, "address": "TKpCiG3yifm2QrMdMwpJLzjFUB1kbc8zPz", "label": "Hotwallet6", "address_id": 1406, "date": "2021-07-21T09:46:27+0200", "db_balance": { "TRX": "0.1", "BTT": "0.03", "USDT": 0 }, "success": true, "status": 200 }
POST https://tron24.top/api/get-address-list-by-label
Name | Type | Mandatory | Description |
label | string | yes |
{ "items": [ { "id": 2, "address": "TMv9VsAA9qQpQmB9PGcxE7JHusME5Ayzit", "label": "Hotwallet-1", "address_id": 2, "date": "2021-09-10T14:28:29+0000", "db_balance": { "TRX": "0.001", "BTT": 0, "USDT": 0 } }, { "id": 3, "address": "TW39M57Ft1Bw33X2GT54h8EXS3WvApfQLi", "label": "Hotwallet-1", "address_id": 3, "date": "2021-09-10T14:29:15+0000", "db_balance": { "TRX": 0, "BTT": 0, "USDT": 0 } }, { "id": 4, "address": "TUuwDrvRYDioPiWHwMYgwfR7kXNNbSzwus", "label": "Hotwallet-1", "address_id": 4, "date": "2021-09-10T14:29:19+0000", "db_balance": { "TRX": 0, "BTT": 0, "USDT": 0 } } ], "success": true, "status": 200 }
POST https://tron24.top/api/address-list
Name | Type | Mandatory | Description |
page | integer | yes | |
limit | integer | yes | min 1 , max 100 |
{ "items": [ { "id": 1405, "address": "TQ7crrfxsViWF5jjuWcXzaARzQ2tbHdFcG", "label": "1", "address_id": 1405, "date": "2021-07-21T09:46:27+0200", "db_balance": { "TRX": "0.30005", "BTT": "1.19", "USDT": 0 } }, { "id": 1406, "address": "TKpCiG3yifm2QrMdMwpJLzjFUB1kbc8zPz", "label": "1", "address_id": 1406, "date": "2021-07-21T09:46:27+0200", "db_balance": { "TRX": "0.1", "BTT": "0.03", "USDT": 0 } }, { "id": 1746, "address": "TM8o7qHQscNXiVtxFyNDnzzNpkySQn2ySo", "label": "", "address_id": 1746, "date": "2021-07-22T13:32:57+0200", "db_balance": { "TRX": "-0.30002", "BTT": 0, "USDT": "0.000001" } }, { "id": 1747, "address": "TBzRHALsH7nqSMGY5buxyDQbShtrAG6N3E", "label": "", "address_id": 1747, "date": "2021-07-22T13:33:07+0200", "db_balance": { "TRX": 0, "BTT": 0, "USDT": 0 } } ], "total": 24, "limit": 4, "page": 1, "success": true, "status": 200 }
POST https://tron24.top/api/transaction-list
Name | Type | Mandatory | Description |
page | integer | yes | |
limit | integer | yes | |
address_id | integer | no | address_id is unique that returned in generate address API |
type | string | no | deposit or withdraw |
txid | string | no | Tron network txid |
coin | string | no | BTT , TRX , USDT |
status | string | no | Tron Network status SUCCESS OUT_OF_ENERGY |
{ "items": [ { "id": 1, "txid": "bb77b2f227f8fd24c179ab0f2ea721ec6bb17f1b89628a908ca32a3d34f88992", "blockchain_time": 1631221317, "blockchain_date": "2021-09-09T21:01:57+0000", "fee": "0", "fee_coin": "TRX", "status": "SUCCESS", "owner_address": "TVCGWdbM7fDuCEcGib9WKDibqUdJ3LWtRK", "amount": "2", "to_address": "TE6xEKThPqnt371cinVPhpnRTYC2Hr4Vwb", "coin": "TRX", "address_id": 1, "address_label": "init", "type": "deposit", "block_id": 33569657, "time": 1631221383, "date": "2021-09-09T21:03:03+0000" }, { "id": 2, "txid": "7812cb4cbc0e6d7d17a0ee520eda6e809d4116c24ee0daefd665a3ffed1717d7", "blockchain_time": 1631221458, "blockchain_date": "2021-09-09T21:04:18+0000", "fee": "0", "fee_coin": "TRX", "status": "SUCCESS", "owner_address": "TE6xEKThPqnt371cinVPhpnRTYC2Hr4Vwb", "amount": "1", "to_address": "TPcQ4ueun6WRQ28iWqVSByswH1NhyZoEkz", "coin": "TRX", "address_id": 1, "address_label": "init", "type": "withdraw", "block_id": 33569704, "time": 1631221562, "date": "2021-09-09T21:06:02+0000" }, { "id": 3, "txid": "3381bce86e62f2b1ac363787b6a64d620b7fc7d96b286715770a4201eb9a30b7", "blockchain_time": 1631221533, "blockchain_date": "2021-09-09T21:05:33+0000", "fee": "0", "fee_coin": "TRX", "status": "SUCCESS", "owner_address": "TE6xEKThPqnt371cinVPhpnRTYC2Hr4Vwb", "amount": "1", "to_address": "TPcQ4ueun6WRQ28iWqVSByswH1NhyZoEkz", "coin": "TRX", "address_id": 1, "address_label": "init", "type": "withdraw", "block_id": 33569729, "time": 1631221622, "date": "2021-09-09T21:07:02+0000" } ], "total": 7, "limit": 3, "page": 1, "success": true, "status": 200 }
POST https://tron24.top/api/total-balance
Response:
{ "result": { "TRX": "1.732131", "USDT": "300", "BTT": "2", "USDC": "0" }, "success": true, "status": 200 }
POST https://tron24.top/api/resource
Name | Type | Mandatory | Description |
address_id | integer | yes | address_id |
{ "energy": 65000, "bandwidth": 0, "total_bandwidth": 600, "success": true, "status": 200 }
POST https://tron24.top/api/rent-energy
Name | Type | Mandatory | Description |
address_id | integer | yes | address_id |
amount | integer | yes |
Recipient address with balance in USDT, requires 32000 energy
Recipient address without balance in USDT, requires 65000 energy |
period | integer | yes |
1 hour = 3600 seconds 1 day = 86400 seconds 3 days = 259200 seconds 30 days = 2592000 seconds |
{ "success": true, "result": { "result": "26044-109-549bb5846c", "address_id": 100, "item": { "id": 26044, "trackid": "26044-109-549bb5846c", "address": "TWTeSauztn3m9j91PCny9E25i7ep3MQjc1", "resource": "ENERGY", "amount": "65000.0000000000", "period": 7200, "price": "0.0000875000", "cost": "1.3125000000", "date": "2024-04-04", "time": 1712243443, "assign_time": 0, "txid": null, "status": "waiting", "agent": "API" }, "success": true, "status": 200 }, "status": 200 }
After each withdraw and deposit on wallet , system send details with post to your webhook URL .
There is a list of params that will be send!
Name | Type | Sample | Description |
id | integer | 1 | Transaction Id in wallet db |
txid | string | 962a...4b67 | network txid |
blockchain_time | integer | 1631221680 | UNIX timestamp |
blockchain_date | string | 2021-09-09T21:08:00+0000 | date format in ISO8601 |
fee | float | 0 | TRX Fee used for withdraw |
fee_coin | string | TRX | |
status | string | SUCCESS | SUCCESS is means everything is fine! |
owner_address | string | TPcQ4ueun6WRQ28iWqVSByswH1NhyZoEkz | Sender Account |
amount | float | 2.1 | |
coin | string | TRX | TRX , BTT , USDT |
to_address | string | TE6xEKThPqnt371cinVPhpnRTYC2Hr4Vwb | receiver address |
address_id | integer | 2 | related address |
address_label | string | hotwallet6 | |
type | string | withdraw | deposit ,withdraw |
block_id | integer | 33569778 | block id on the network |
time | integer | 1631221690 | UNIX timestamp |
date | string | 2021-09-09T21:08:10+0000 | date format in ISO8601 |