feat(wallet): add balance mutation clients
This commit is contained in:
@@ -59,3 +59,23 @@ export async function listWalletTransactions(
|
||||
)
|
||||
return res.items
|
||||
}
|
||||
|
||||
export async function topUpWallet(input: { amount: number; method?: string }): Promise<void> {
|
||||
await httpJson<unknown>("/api/v1/wallet/topup", {
|
||||
method: "POST",
|
||||
json: {
|
||||
amount: String(input.amount),
|
||||
method: input.method ?? "dev",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export async function withdrawWallet(input: { amount: number; method?: string }): Promise<void> {
|
||||
await httpJson<unknown>("/api/v1/wallet/withdraw", {
|
||||
method: "POST",
|
||||
json: {
|
||||
amount: String(input.amount),
|
||||
method: input.method ?? "dev",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user