"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),utils_1=require("../utils"),query_1=require("@b/utils/query"),error_1=require("@b/utils/error");exports.metadata={summary:"Get a single exchange currency",operationId:"getCurrency",tags:["Admin","Exchange Currencies"],description:"Retrieve details of a single exchange currency by ID",parameters:[{in:"path",name:"id",required:!0,schema:{type:"string"},description:"ID of the exchange currency"}],responses:{200:{description:"Details of the exchange currency",content:{"application/json":{schema:{type:"object",properties:utils_1.baseExchangeCurrencySchema}}}},401:query_1.unauthorizedResponse,404:(0,query_1.notFoundMetadataResponse)("Exchange Currency"),500:query_1.serverErrorResponse},permission:"view.spot.currency",logModule:"ADMIN_FIN",logTitle:"Get Exchange Currency"};exports.default=async e=>{const{params:r,ctx:t}=e;null==t||t.step("Fetching exchange currency");const n=await db_1.models.exchangeCurrency.findOne({where:{id:parseInt(r.id)}});if(!n)throw(0,error_1.createError)({statusCode:404,message:"Currency not found"});null==t||t.success("Exchange currency retrieved successfully");return n.get({plain:!0})};