@renegade-fi/node
Version:
Node.js library for Renegade
14 lines • 686 B
JavaScript
import { getWalletId, payFees, waitForTaskCompletionWs, withdraw, } from "@renegade-fi/core";
export async function executeWithdrawal(config, parameters) {
const walletId = getWalletId(config);
console.log(`Paying fees for wallet ${walletId}`);
await payFees(config);
console.log(`Initiating withdrawal of ${parameters.amount} ${parameters.mint} for wallet ${walletId}`);
const { taskId } = await withdraw(config, parameters);
if (parameters.awaitTask) {
await waitForTaskCompletionWs(config, { id: taskId });
console.log(`Withdrawal completed for wallet ${walletId}`);
}
return { taskId };
}
//# sourceMappingURL=executeWithdrawal.js.map