first commit

This commit is contained in:
xuyong
2026-04-15 21:35:26 +08:00
commit 7097fa6b44
69 changed files with 5642 additions and 0 deletions

View 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}`),
};