UNPKG

@renegade-fi/core

Version:
27 lines 950 B
import { PAY_FEES_ROUTE } from "../constants.js"; import { postRelayerWithAuth } from "../utils/http.js"; import { getWalletId } from "./getWalletId.js"; export async function payFees(config) { const { getBaseUrl } = config; const walletId = getWalletId(config); const logger = config.getLogger("core:actions:payFees"); try { const res = await postRelayerWithAuth(config, getBaseUrl(PAY_FEES_ROUTE(walletId))); if (res?.task_ids) { for (const id of res.task_ids) { logger.debug(`task pay-fees(${id}): ${walletId}`, { walletId, taskId: id, }); } } return { taskIds: res.task_ids }; } catch (error) { logger.error(`Pay fees failed: ${error instanceof Error ? error.message : String(error)}`, { walletId, }); throw error; } } //# sourceMappingURL=payFees.js.map