"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const query_1=require("@b/utils/query"),utils_1=require("../utils");exports.metadata={summary:"Updates an existing exchange currency",operationId:"updateExchangeCurrency",tags:["Admin","Exchange","Currencies"],parameters:[{name:"id",in:"path",required:!0,description:"The ID of the currency to update.",schema:{type:"string"}}],requestBody:{required:!0,description:"Updated data for the exchange currency",content:{"application/json":{schema:utils_1.exchangeCurrencyUpdateSchema}}},responses:(0,query_1.updateRecordResponses)("Exchange Currency"),requiresAuth:!0,permission:"edit.spot.currency",logModule:"ADMIN_FIN",logTitle:"Update spot currency"};exports.default=async e=>{const{body:r,params:t,ctx:c}=e,{id:s}=t,{name:n,chains:a}=r;null==c||c.step("Fetching spot currency record");null==c||c.step("Updating spot currency");const u=await(0,query_1.updateRecord)("exchangeCurrency",s,{name:n,chains:a});null==c||c.success("Spot currency updated successfully");return u};