@renegade-fi/core
Version:
VanillaJS library for Renegade
27 lines • 950 B
JavaScript
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