Skip to content

Commit

Permalink
Check for permissions before getting addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
lserra-iov authored and alexjavabraz committed Jan 16, 2025
1 parent a524913 commit 9e678e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/services/XverseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export default class XverseService extends WalletService {
}
}

getAccountAddresses(): Promise<WalletAddress[]> {
async getAccountAddresses(): Promise<WalletAddress[]> {
// @ts-expect-error method type not provided
const permissions = await Wallet.request('wallet_getCurrentPermissions', undefined);
if (permissions.status !== 'success') {
// @ts-expect-error method type not provided
await Wallet.request('wallet_requestPermissions', undefined);
}
return new Promise<WalletAddress[]>((resolve, reject) => {
const walletAddresses: WalletAddress[] = [];
const payload = {
Expand Down

0 comments on commit 9e678e2

Please sign in to comment.