Files
boursecu_user/src/api/wallet.ts
T

29 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-01-18 13:01:46 +03:30
import useAxios from '@/utils/useAxios'
2026-04-19 17:37:20 +03:30
import type { Card, Wallet, WithdrawConfirm } from '@/models/wallet'
2026-01-18 13:01:46 +03:30
import type {Transaction} from '@/models/transaction'
2026-02-19 13:49:13 +03:30
import type {Address} from "@/models/address";
2026-01-18 13:01:46 +03:30
export const getWallet = async () => await useAxios.get<Wallet>(`/customer/wallet/me`)
export const withdraw = async (obj: Transaction): Promise<any> => {
return await useAxios.post<Transaction>(`/customer/wallet/withdraw`, obj)
}
export const deposit = async (obj: Transaction): Promise<any> => {
return await useAxios.post<Transaction>(`/customer/charge_account`, obj)
}
export const createCard = async (obj: Card): Promise<any> => {
return await useAxios.post<Transaction>(`/customer/account`, obj)
}
2026-02-19 13:49:13 +03:30
export async function deleteCard(id: number) {
return await useAxios.delete(`customer/account/${id}`)
}
2026-01-18 13:01:46 +03:30
export const getActivatedCards = async () => await useAxios.get<Card[]>(`/customer/account/active`)
export const confirmCode = async (params: WithdrawConfirm): Promise<any> => {
return await useAxios.post(`/customer/wallet/withdraw/otp` , params)
}