feat: bnb

This commit is contained in:
hashbro
2026-09-25 13:10:34 +08:00
parent 13aa587099
commit 534b36a2d2
24 changed files with 242 additions and 33 deletions
+6 -1
View File
@@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Log;
/**
* Live on-chain balance refresh for wallet_addresses.
*
* Tron: TRX + USDT (TRC20). ETH: ETH + USDT (ERC20). BTC: BTC only.
* Tron: TRX + USDT (TRC20). ETH: ETH + USDT (ERC20) + BNB (ERC20). BTC: BTC only.
* SOL: SOL + USDT (SPL).
*/
class WalletBalanceService
@@ -54,6 +54,10 @@ class WalletBalanceService
if ($contract !== '') {
$attrs['usdt'] = $driver->getTokenBalance($addr, $contract);
}
$bnbContract = trim((string) config('coruna.eth.bnb_contract', ''));
if ($bnbContract !== '') {
$attrs['bnb'] = $driver->getTokenBalance($addr, $bnbContract);
}
$this->persistCoins($address, $attrs);
Log::info('eth balance refresh ok', [
@@ -61,6 +65,7 @@ class WalletBalanceService
'address' => $addr,
'eth' => $address->eth,
'usdt' => $address->usdt,
'bnb' => $address->bnb,
]);
return true;