예제 #1
0
파일: Order.php 프로젝트: poiuty/midas
 /**
  * Deposit fee to exchange balance.
  *
  * @param float $amount
  * @param int   $wallet_id
  */
 public static function depositFee($amount, $wallet_id)
 {
     $wallet = Wallet::find($wallet_id);
     $exchange_bot = User::where('email', config('exchange.bot'))->first();
     $bot_wallet_id = $wallet->generateUserAddress($exchange_bot);
     $bot_wallet = WalletsAddress::where('id', $bot_wallet_id)->first();
     $bot_wallet->deposit($amount);
     return true;
 }
예제 #2
0
 public function getAddress($wallet_id)
 {
     $response = ['error' => false];
     $wallet = Wallet::find($wallet_id);
     if ($wallet) {
         $address = $wallet->generateUserDepositAddress(Auth::user());
         if ($address) {
             $response['address'] = $address;
         } else {
             $response['error'] = 'Can\'t generate your address. Please try again.';
         }
     } else {
         $response['error'] = 'Wallet not found';
     }
     echo json_encode($response);
 }