@renegade-fi/node
Version:
Node.js library for Renegade
17 lines • 694 B
JavaScript
import { getWalletId, waitForTaskCompletionWs, withdraw, } from "@renegade-fi/core";
export async function executeWithdrawal(config, parameters) {
const walletId = getWalletId(config);
const logger = config.getLogger("node:actions:executeWithdrawal");
logger.debug("Initiating withdrawal", {
walletId,
mint: parameters.mint,
amount: parameters.amount,
});
const { taskId } = await withdraw(config, parameters);
if (parameters.awaitTask) {
await waitForTaskCompletionWs(config, { id: taskId });
logger.debug("Withdrawal completed", { walletId, taskId });
}
return { taskId };
}
//# sourceMappingURL=executeWithdrawal.js.map