@puzzlehq/sdk-core
Version:
Your portal to privacy
17 lines (16 loc) • 529 B
JavaScript
import { waitForInjectedConnection } from '../utils/clientInfo.js';
export const getIsConnected = async () => {
await waitForInjectedConnection();
if (!window.aleo.puzzleWalletClient.isConnected?.query)
throw new Error('isConnected.query not found!');
try {
const isConnected = await window.aleo.puzzleWalletClient.isConnected.query({
method: 'isConnected',
});
return isConnected;
}
catch (e) {
console.error('connect error', e);
throw e;
}
};