fix
This commit is contained in:
+8
-3
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user