عنوان URL الأساسي: https://api.tronnrg.com المصادقة: لا توجد متطلبات. جميع نقاط النهاية عامة. حد المعدل: 20 طلبًا/ثانية لكل عنوان IP عنوان الدفع: TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx ( API فقط، وليس للإيجارات اليدوية)

كيف يعمل

ثلاث خطوات. لا حاجة لمفتاح API ، ولا تسجيل، ولا ربط بالمحفظة. يتم إثبات الملكية تشفيرياً.

  1. إرسال TRX — أرسل 4 TRX (أو أكثر) إلى عنوان الدفع. 4 TRX = 65,000 طاقة. 8 TRX = 130,000. خطي.
  2. لافتة — وقّع على الرسائل {tx_hash}:{delegate_to} باستخدام المحفظة التي أرسلت عملة TRX . هذا يثبت أنك قد فوضت عملية التفويض.
  3. مطالبةPOST /delegate مع tx_hash، delegate_to، و signatureتصل Energy في غضون 3 ثوانٍ تقريبًا.

عنوان الدفع

TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx
عنوان الدفع API فقط. هذا العنوان مخصص لعمليات التكامل البرمجية عبر API . لا تستخدمه لتأجير الطاقة يدويًا. عنوان التأجير اليدوي مختلف ومتاح على موقع .tronnrg.com.

أرسل TRX إلى هذا العنوان. رمز التجزئة الخاص بمعاملة الدفع هو رمزك المميز لتفعيل التفويض. لا يمكن استخدام كل رمز تجزئة إلا مرة واحدة.

تم إرسال TRXEnergy المفوضةحالة الاستخدام
4 TRX65,000تحويل قياسي USDT إلى محفظة موجودة (الحد الأدنى للطلب)
8 TRX130,000تحويل عملة USDT إلى مستلم لأول مرة
16 TRX260,000أربع عمليات نقل قياسية في طلب واحد
40 TRX650,000عشر عمليات نقل قياسية
100 TRX1,625,000حوالي 25 عملية نقل قياسية - أمر شائع في المنصات الصغيرة
1,000 TRX16,250,000الحد الأقصى للطلب: حوالي 250 عملية تحويل قياسية
أي مبلغ بينهماtrx × 16,250خطي بالكامل. لا مستويات، لا باقات، لا خصومات.
صيغة: energy = trxSent × 16,250. الحدود: الحد الأدنى 4 TRX (65,000 طاقة)، والحد الأقصى 1,000 TRX (16,250,000 طاقة). يتم تطبيق كلا الحدين على مستوى API ) - تُرفض المبالغ الأقل من الحد الأدنى مع رمز "low_minimum" ويتم استردادها؛ أما المبالغ الأعلى من الحد الأقصى فتُرفض قبل التفويض. يُرجى دائمًا قراءة القيم الفعلية من طلب GET /supply قبل إدخالها مباشرةً في بيئة الإنتاج - انظر أدناه.

GET /supply

GET/supply

احصل على معلومات التسعير وعنوان الدفع. هذه نقطة معلوماتية فقط - الطاقة متوفرة دائمًا، ولا داعي للتحقق قبل إرسال الدفعة.

curl https://api.tronnrg.com/supply
const supply = await fetch('https://api.tronnrg.com/supply') .then(r => r.json()); // Energy is always available. Use supply.pay_to for the payment address. console.log('Pay to:', supply.pay_to);
import requests supply = requests.get('https://api.tronnrg.com/supply').json() # Energy is always available. Use supply['pay_to'] for the payment address. print(supply['pay_to'])
$supply = json_decode( file_get_contents('https://api.tronnrg.com/supply'), true ); // if less than you require, wait and retry // Energy is always available. Use $supply['pay_to'] for the payment address. echo $supply['pay_to'];
var client = new HttpClient(); var json = await client.GetStringAsync("https://api.tronnrg.com/supply"); var supply = JsonSerializer.Deserialize<JsonElement>(json); // Energy is always available. Use pay_to for the payment address. var payTo = supply.GetProperty("pay_to").GetString();
Response 200
{ "available": true, "energy_per_trx": 16250, "min_order_trx": 4, "max_order_trx": 1000, "pay_to": "TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx", "examples": { "standard": { "trx": 4, "energy": 65000, "note": "Existing USDT wallet" }, "new_wallet": { "trx": 8, "energy": 130000, "note": "First-time USDT recipient" } } }

POST /delegate

POST/delegate

قم بتأكيد تفويض الطاقة. يجب أن تكون قد أرسلتَ بالفعل TRX إلى عنوان الدفع الموجود على سلسلة الكتل. أرسل رمز التجزئة للمعاملة، وعنوان المستلم، وتوقيعًا يثبت أنك المرسل.

ParameterTypeDescription
tx_hashstringrequiredرمز التجزئة السداسي العشري المكون من 64 حرفًا لدفعة TRX
delegate_tostringrequiredعنوان Tron لاستلام الطاقة
signaturestringrequiredSign {tx_hash}:{delegate_to} using tronWeb.trx.signMessageV2(). Proves you are the payment sender.
curl -X POST https://api.tronnrg.com/delegate \ -H "Content-Type: application/json" \ -d '{"tx_hash":"TX_HASH","delegate_to":"TWallet","signature":"SIG"}'
const result = await fetch('https://api.tronnrg.com/delegate', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tx_hash: 'YOUR_TX_HASH', delegate_to: 'TWalletAddress', signature: 'YOUR_SIGNATURE', }), }).then(r => r.json()); if (result.error) { console.error(result.error, result.message); } else { console.log('Delegated:', result.energy, 'energy'); console.log('Ref:', result.ref); }
import requests response = requests.post('https://api.tronnrg.com/delegate', json={ 'tx_hash': 'YOUR_TX_HASH', 'delegate_to': 'TWalletAddress', 'signature': 'YOUR_SIGNATURE', }) result = response.json() if 'error' in result: print(f"Error: {result['error']} - {result['message']}") else: print(f"Delegated: {result['energy']} energy") print(f"Delegation tx: {result['delegations'][0]['tx']}") print(f"Ref: {result['ref']}")
$ch = curl_init('https://api.tronnrg.com/delegate'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode([ 'tx_hash' => 'YOUR_TX_HASH', 'delegate_to' => 'TWalletAddress', 'signature' => 'YOUR_SIGNATURE', ]), ]); $result = json_decode(curl_exec($ch), true); curl_close($ch); if (isset($result['error'])) { echo "Error: " . $result['message']; } else { echo "Delegated: " . $result['energy'] . " energy"; }
var client = new HttpClient(); var content = new StringContent( JsonSerializer.Serialize(new { tx_hash = "YOUR_TX_HASH", delegate_to = "TWalletAddress", signature = "YOUR_SIGNATURE" }), Encoding.UTF8, "application/json" ); var response = await client.PostAsync("https://api.tronnrg.com/delegate", content); var json = await response.Content.ReadAsStringAsync(); var result = JsonSerializer.Deserialize<JsonElement>(json); if (result.TryGetProperty("error", out var err)) Console.WriteLine($"Error: {err}"); else Console.WriteLine($"Delegated: {result.GetProperty("energy")} energy");
Response 200
{ "ref": "nrg_d_42", "delegate_to": "TWalletAddress", "energy": 65000, "cost": 4, "status": "delegated", "delegations": [ { "tx": "a1b2c3d4e5f6...your delegation tx hash", "energy": 65000 } ] }
FieldTypeDescription
refstringرقم مرجع TronNRG . سجّل هذا الرقم للاستفسارات المتعلقة بالدعم.
energynumberإجمالي الطاقة المفوضة
costnumberرسوم TRX
statusstring&quot;مفوض&quot; عند النجاح
delegationsarrayOn-chain delegation transaction hashes. Each tx is verifiable on TronScan. This is your receipt.

GET /health

GET/health

Liveness check for monitoring and uptime tools. Returns 200 OK when the API process is up. Does not check upstream nodes or providers.

Response 200
{ "status": "ok" }

رموز الخطأ

Every error response has error (stable, machine-readable) and message (human-readable). Always switch on error.

CodeHTTPMeaning
invalid_tx_hash400ليس سلسلة سداسية عشرية مكونة من 64 حرفًا
invalid_address400عنوان Tron غير صالح
missing_signature400لم يتم تقديم أي توقيع
invalid_signature401تعذر التحقق من التوقيع
signature_mismatch403عنوان المُوقِّع لا يتطابق مع عنوان مُرسِل الدفعة
hash_already_used409تم بالفعل المطالبة برمز تجزئة المعاملة
payment_verification_failed404 / 400On-chain verification of the payment failed. Read the message field for the specific cause: tx not found yet (404, retry in a few seconds), wrong recipient, not a TRX transfer, or below the 4 TRX minimum.
delegation_failed400 / 500Provider could not deliver energy. If the failure happened after the payment was verified, an automatic refund is queued. The error response includes a refund object when this happens.
rate_limited429عدد الطلبات الواردة من هذا العنوان IP يتجاوز الحد المسموح به وهو 20 طلبًا في الثانية.
server_error500حدث خطأ داخلي غير متوقع. أعد المحاولة خلال بضع ثوانٍ.
const result = await fetch('https://api.tronnrg.com/delegate', { ... }) .then(r => r.json()); if (result.error) { switch (result.error) { case 'payment_verification_failed': // Most common cause: tx not yet indexed. Wait 3s and retry. // Read result.message for the specific cause. break; case 'hash_already_used': // Already claimed. Don't retry. break; case 'signature_mismatch': // Signer != payment sender. Sign with the same key that sent TRX. break; case 'delegation_failed': // Refund queued automatically if payment was verified. if (result.refund) console.log('Refund queued:', result.refund); break; } }
result = requests.post('https://api.tronnrg.com/delegate', json=data).json() if 'error' in result: if result['error'] == 'payment_verification_failed': # Most common cause: tx not yet indexed. Wait 3s and retry. pass elif result['error'] == 'hash_already_used': # Already claimed. Don't retry. pass elif result['error'] == 'signature_mismatch': # Signer != payment sender. Sign with the same key. pass elif result['error'] == 'delegation_failed': # Refund queued automatically if payment was verified. pass
if (isset($result['error'])) { switch ($result['error']) { case 'payment_verification_failed': // Most common cause: tx not yet indexed. Wait 3s and retry. break; case 'hash_already_used': // Already claimed. Don't retry. break; case 'signature_mismatch': // Signer != payment sender. Sign with the same key. break; case 'delegation_failed': // Refund queued automatically if payment was verified. break; } }

Refunds

إذا فشلت عملية التفويض بعد التحقق من دفعتك، فسيتم تلقائيًا وضع استرداد TRX في قائمة الانتظار وإرساله مرة أخرى إلى عنوان المرسل على سلسلة الكتل. ابحث عن عنصر الاسترداد في رد الخطأ.

Error with refund
{ "error": "delegation_failed", "message": "Energy delegation failed. Your payment will be refunded.", "ref": "nrg_d_43", "refund": { "type": "queued", "to": "TSenderAddress", "amount": 4 } }

مثال كامل

العملية الكاملة من البداية إلى النهاية: إرسال TRX ، التوقيع، المطالبة مع إعادة المحاولة. انسخها ونفذها.

const API = 'https://api.tronnrg.com'; const ADDR = 'TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx'; async function rentEnergy(delegateTo, trxAmount = 4) { // 1. Send TRX to the payment address const payment = await tronWeb.trx.sendTransaction(ADDR, trxAmount * 1e6); // 2. Sign: proves you are the sender const message = `${payment.txid}:${delegateTo}`; const signature = await tronWeb.trx.signMessageV2(message); // 3. Claim delegation (retry if tx not indexed yet) let result; for (let i = 0; i < 3; i++) { result = await fetch(`${API}/delegate`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tx_hash: payment.txid, delegate_to: delegateTo, signature, }), }).then(r => r.json()); if (!result.error) break; if (result.error !== 'payment_verification_failed') throw new Error(result.message); await new Promise(r => setTimeout(r, 3000)); } if (result.error) throw new Error(result.message); return result; } // Usage — send any amount between 4 and 1,000 TRX const result = await rentEnergy('TWalletThatNeedsEnergy', 4); // 4 TRX → 65k energy // rentEnergy(addr, 8) // → 130,000 energy (new-wallet transfer) // rentEnergy(addr, 40) // → 650,000 energy (10 transfers) // rentEnergy(addr, 1000) // → 16,250,000 energy (max) console.log(result.energy); // trxAmount × 16,250 console.log(result.delegations[0].tx); // on-chain tx hash console.log(result.ref); // "nrg_d_42"
import requests import time API = 'https://api.tronnrg.com' ADDR = 'TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx' def rent_energy(delegate_to, trx_amount=4): # 1. Send TRX to ADDR (via your Tron library) tx_hash = send_trx(ADDR, trx_amount) # your TRX send function # 2. Sign: proves you are the sender message = f'{tx_hash}:{delegate_to}' signature = tron.trx.sign_message_v2(message) # 3. Claim delegation (retry if tx not indexed yet) for attempt in range(3): result = requests.post(f'{API}/delegate', json={ 'tx_hash': tx_hash, 'delegate_to': delegate_to, 'signature': signature, }).json() if 'error' not in result: return result if result['error'] != 'payment_verification_failed': raise Exception(result['message']) time.sleep(3) raise Exception('Transaction not found after retries') # Usage result = rent_energy('TWalletThatNeedsEnergy', 4) print(f"Delegated: {result['energy']} energy") print(f"Delegation tx: {result['delegations'][0]['tx']}") print(f"Ref: {result['ref']}")
<?php $api = 'https://api.tronnrg.com'; $addr = 'TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx'; function rentEnergy($api, $txHash, $delegateTo, $signature) { // 1. Send TRX to $addr (via iexbase/tron-api) // $payment = $tron->sendTrx($addr, 4); // $txHash = $payment['txid']; // 3. Claim delegation (retry if tx not indexed yet) for ($i = 0; $i < 3; $i++) { $ch = curl_init("${api}/delegate"); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode([ 'tx_hash' => $txHash, 'delegate_to' => $delegateTo, 'signature' => $signature, ]), ]); $result = json_decode(curl_exec($ch), true); curl_close($ch); if (!isset($result['error'])) return $result; if ($result['error'] !== 'payment_verification_failed') throw new Exception($result['message']); sleep(3); } throw new Exception('Transaction not found after retries'); } // Usage $result = rentEnergy($api, $txHash, 'TWalletThatNeedsEnergy'); echo "Delegated: " . $result['energy'] . " energy\n"; echo "Delegation tx: " . $result['delegations'][0]['tx'] . "\n"; echo "Ref: " . $result['ref'] . "\n";
# 1. Send TRX to TFqUiCu1JwLHHnBNeaaVKH7Csm4aA3YhZx # Pricing is linear at 16,250 energy per TRX. # Min 4 TRX (65,000 energy), max 1,000 TRX (16.25M energy). # (use your wallet or tronweb CLI) # 2. Sign the message {tx_hash}:{delegate_to} (proves you are the sender) # (use tronWeb.trx.signMessageV2 in your code) # 3. Claim delegation with tx hash + signature curl -X POST https://api.tronnrg.com/delegate \ -H "Content-Type: application/json" \ -d '{ "tx_hash": "YOUR_PAYMENT_TX_HASH", "delegate_to": "TWalletThatNeedsEnergy", "signature": "YOUR_SIGNATURE" }' # Response includes delegations[].tx — the on-chain hash you can verify on TronScan
Telegram WhatsApp