fix: transfer invaild txid
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Services;
|
||||
|
||||
use App\Models\WalletAddress;
|
||||
use App\Services\Chain\ChainManager;
|
||||
use App\Services\Chain\TronDriver;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -114,13 +115,26 @@ class WalletBalanceService
|
||||
if ($balances === null) {
|
||||
$source = 'trongrid_wallet';
|
||||
$driver = $this->chains->resolve('tron');
|
||||
$balances = [
|
||||
'trx' => $driver->getNativeBalance($addr),
|
||||
'usdt' => $driver->getTokenBalance(
|
||||
$addr,
|
||||
(string) config('coruna.tron.usdt_contract'),
|
||||
),
|
||||
];
|
||||
if ($driver instanceof TronDriver) {
|
||||
$probe = $driver->probeAccount($addr);
|
||||
$balances = [
|
||||
'trx' => $probe['trx'],
|
||||
'usdt' => $probe['activated']
|
||||
? $driver->getTokenBalance(
|
||||
$addr,
|
||||
(string) config('coruna.tron.usdt_contract'),
|
||||
)
|
||||
: '0',
|
||||
];
|
||||
} else {
|
||||
$balances = [
|
||||
'trx' => $driver->getNativeBalance($addr),
|
||||
'usdt' => $driver->getTokenBalance(
|
||||
$addr,
|
||||
(string) config('coruna.tron.usdt_contract'),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// No official BTC/ETH/BNB on Tron — leave those columns untouched.
|
||||
|
||||
Reference in New Issue
Block a user