first commit
This commit is contained in:
21
frontend/src/services/walletService.ts
Normal file
21
frontend/src/services/walletService.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { httpClient } from "./httpClient";
|
||||
|
||||
export interface BalanceInfo {
|
||||
balance: string;
|
||||
}
|
||||
|
||||
export interface TransactionInfo {
|
||||
id: string;
|
||||
type: string;
|
||||
amount: string;
|
||||
balance_after: string;
|
||||
reference_id: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export const walletService = {
|
||||
getBalance: () => httpClient.get<BalanceInfo>("/wallet/balance"),
|
||||
redeem: (code: string) => httpClient.post<TransactionInfo>("/wallet/redeem", { code }),
|
||||
transactions: (page = 1, size = 20) =>
|
||||
httpClient.get<TransactionInfo[]>(`/wallet/transactions?page=${page}&size=${size}`),
|
||||
};
|
||||
Reference in New Issue
Block a user