<?php
namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Models\Asset;
use App\Support\ApiResponse;
use App\Support\AtomicAmount;
final class CurrencyController extends Controller { public function __invoke(){return ApiResponse::success(Asset::orderBy('code')->get()->map(fn($a)=>['code'=>$a->code,'name'=>$a->name,'network'=>$a->network,'decimals'=>$a->decimals,'minimum_payment'=>AtomicAmount::toDecimal((string)$a->min_amount_atomic,$a->decimals),'required_confirmations'=>(int)($a->confirmation_policy['final']??1),'enabled'=>$a->enabled])->values());} }
