This commit is contained in:
2026-09-11 23:10:13 +08:00
parent 89ee2496a6
commit dbcbe161b5
5 changed files with 89 additions and 62 deletions
+8 -3
View File
@@ -152,13 +152,18 @@ class Api {
return data.data?.wallets ?? [];
}
public async getWalletVpas(walletId: string): Promise<string[]> {
const res = await fetch(`${Api.BASE_URL}/wallet/vpas?walletId=${encodeURIComponent(walletId)}`, {
public async getAccountInfo(walletId: string): Promise<{ vpa?: string; vpas?: string[]; phone?: string }> {
const res = await fetch(`${Api.BASE_URL}/account-info?walletId=${encodeURIComponent(walletId)}`, {
headers: this.headers(),
});
const data = await res.json();
if (!data.success) throw new Error(data.message);
return data.data?.vpas ?? [];
return data.data?.account ?? {};
}
public async getWalletVpas(walletId: string): Promise<string[]> {
const account = await this.getAccountInfo(walletId);
return account.vpas ?? [];
}
public async setCurrentVpa(walletId: string, vpaIndex: number): Promise<string> {