|
|
|
@ -92,7 +92,7 @@ class CoinService |
|
|
|
*/ |
|
|
|
public function createAddress($wallet, $coin_name, $addressType = null) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
$map = [ |
|
|
|
'BTC' => 0, |
|
|
|
'ETH' => 60, |
|
|
|
@ -104,11 +104,11 @@ class CoinService |
|
|
|
// dd($map,$coin_name); |
|
|
|
$coinType = $map[$coin_name] ?? null; |
|
|
|
if (blank($coinType)) return; |
|
|
|
|
|
|
|
// info($coinType); |
|
|
|
if (blank($addressType)) { |
|
|
|
// dd('22221'); |
|
|
|
$res = (new UdunWalletService())->createAddress($coinType); |
|
|
|
info($res); |
|
|
|
// info($res); |
|
|
|
if ($res['code'] == 200) { |
|
|
|
$address = $res['data']['address']; |
|
|
|
$wallet->update(['wallet_address' => $address]); |
|
|
|
@ -124,9 +124,9 @@ class CoinService |
|
|
|
$account = UserWallet::query()->where(['user_id' => $wallet['user_id'], 'coin_name' => 'TRX'])->first(); |
|
|
|
$field = 'trx_wallet_address'; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (empty($account['wallet_address'])) { |
|
|
|
|
|
|
|
|
|
|
|
$res = (new UdunWalletService())->createAddress($coinType); |
|
|
|
if ($res['code'] == 200) { |
|
|
|
$address = $res['data']['address']; |
|
|
|
|