"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.metadata=void 0;const db_1=require("@b/db"),cache_1=require("@b/utils/cache"),console_1=require("@b/utils/console");exports.metadata={summary:"Get wallet types available for transfers",operationId:"getTransferWalletTypes",tags:["Finance","Transfer","Wallets"],responses:{200:{description:"Available wallet types for transfers",content:{"application/json":{schema:{type:"object",properties:{types:{type:"array",items:{type:"object",properties:{id:{type:"string",enum:["FIAT","SPOT","ECO","FUTURES"]},name:{type:"string"}}}}}}}}}}};exports.default=async()=>{const e=[];try{const t=cache_1.CacheManager.getInstance(),a=await t.getSetting("fiatWallets"),s=await t.getSetting("spotWallets"),r=!0===s||"true"===s;(!0===a||"true"===a)&&e.push({id:"FIAT",name:"Fiat"});if(await db_1.models.exchange.findOne({where:{status:!0}})){r&&e.push({id:"SPOT",name:"Spot"});e.push({id:"FUTURES",name:"Futures"})}}catch(e){console_1.logger.warn("WALLET","Error checking wallet settings",e)}try{const t=cache_1.CacheManager.getInstance(),a=await t.getExtensions();a&&a.has("ecosystem")&&e.push({id:"ECO",name:"Eco"})}catch(e){console_1.logger.warn("WALLET","Error checking ecosystem extension",e)}return{types:e}};