@extends('user.layouts.app') @section('content')

{{ __('Wallet List') }}

{{ __('Here you will get all of your Fiat and Crypto wallets including default one. You can also perform crypto send/receive of your crypto coins.') }}

@if($wallets->count() > 0) @foreach ($wallets as $wallet) @php $walletCurrencyCode = encrypt(optional($wallet->currency)->code); $walletId = encrypt($wallet->id); $provider = isset($wallet->cryptoAssetApiLogs->payment_method->name) && !empty($wallet->cryptoAssetApiLogs->payment_method->name) ? strtolower($wallet->cryptoAssetApiLogs->payment_method->name): ''; @endphp
{{ __('Currency') }}
{{ ucwords(str_replace('_', ' ', $wallet->currency?->type)) }}

{{ $wallet->currency?->code }}{{ $wallet->is_default == 'Yes' ? '(default)' : '' }}

{{ __('Balance') }}

{{ formatNumber($wallet->balance, $wallet->currency?->id) }}

@php $lastTransaction = \App\Models\Transaction::with('transaction_type')->where('currency_id', $wallet->currency?->id)->where(function($query){ $query->where('user_id', auth()->id())->orWhere('end_user_id', auth()->id()); })->latest()->first(); @endphp @if (is_null($lastTransaction))

{{ __('Last Action') }}: {{ __('No transaction available.') }}

@else

{{ __('Last Action') }}: {{ moneyFormat($wallet->currency->symbol, formatNumber($lastTransaction->subtotal)) }} @php if (!empty($lastTransaction)) { if ($lastTransaction->transaction_type->name == 'Transferred') { $transactionName = 'Money Transfer'; } elseif ($lastTransaction->transaction_type->name == 'Received') { $transactionName = 'Money Received'; } elseif ($lastTransaction->transaction_type->name == 'Exchange_From' || $lastTransaction->transaction_type->name == 'Exchange_To') { $transactionName = 'Money Exchange'; } elseif ($lastTransaction->transaction_type->name == 'Request_Sent' || $lastTransaction->transaction_type->name == 'Request_Received') { $transactionName = 'Request Money'; } else { if (str_contains($lastTransaction->transaction_type->name, '_')) { $transactionName = str_replace('_', ' ', $lastTransaction->transaction_type->name); } else { $transactionName = $lastTransaction->transaction_type->name; } } } @endphp ( {{ $transactionName }} )

@endif
@if (($wallet->currency->type == 'crypto' || $wallet->currency->type == 'fiat') && $wallet->currency->status == 'Active') @if(Common::has_permission(auth()->id(), 'manage_deposit')) @endif {!! Common::has_permission(auth()->id(),'manage_deposit') && Common::has_permission(auth()->id(),'manage_withdrawal') ? '
' : '' !!} @if(Common::has_permission(auth()->id(),'manage_withdrawal')) @endif @elseif (optional($wallet->currency)->type == 'crypto_asset' && $tatum_provider_status == 'Active' && isActive('TatumIo') && (optional($wallet->cryptoAssetApiLogs)->payment_method_id == TatumIo) && (optional($wallet->currency)->status == 'Active')) @if(Common::has_permission(auth()->id(),'manage_crypto_send_receive'))
@endif @elseif (optional($wallet->currency)->type == 'crypto_token' && $tatum_provider_status == 'Active' && isActive('TatumIo') && (optional($wallet->currency)->status == 'Active')) @if(Common::has_permission(auth()->id(),'manage_crypto_send_receive'))
@endif @endif
@endforeach @endif
@endsection