/** * Import types from Nadal. */ import type { PaymentWithdrawBankRequestPayload } from '@kira-dancer/nadal' import { DEPOSIT_WITHDRAW_API } from '#lib/configs/api' import type { BaseNadalResponse } from '#lib/types/api' import { useAPI } from '#lib/composables' export const useWithdrawService = () => { /** * Creates a withdrawal request for cryptocurrency. * * PaymentWithdrawBankRequestPayload type is imported from the Nadal module. * * @param {PaymentWithdrawBankRequestPayload} data - The payload containing the details of the withdrawal request. * @returns {Promise>} - A promise resolving to the API response containing the result of the withdrawal request. */ const createWithdrawCrypto = (data: PaymentWithdrawBankRequestPayload) => { return useAPI(DEPOSIT_WITHDRAW_API.WITHDRAW_CRYPTO, { body: data, method: 'post', }) } return { createWithdrawCrypto, } }