UNPKG

@renegade-fi/node

Version:
14 lines 686 B
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