24 lines
913 B
TypeScript
24 lines
913 B
TypeScript
import useAxios from '@/utils/useAxios'
|
|||
|
|
import type { Card, Wallet } from '@/models/wallet'
|
||
|
|
import type {Transaction} from '@/models/transaction'
|
||
|
|
|
||
|
|
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)
|
||
|
|
}
|
||
|
|
|
||
|
|
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)
|
||
|
|
}
|