<?php
require __DIR__.'/_bootstrap.php';
use Zoo\Database;
use Zoo\Admin\AdminApiAuth;
use Zoo\Admin\WithdrawalAdminService;

try {
    AdminApiAuth::requireKey();
    json_out(['ok'=>true,'withdrawals'=>(new WithdrawalAdminService(Database::connect()))->pending()]);
} catch(Throwable $e) {
    json_out(['ok'=>false,'error'=>$e->getMessage()],403);
}
