<p>If the wallet follows CIP-0030 the <code>cardano</code> object should be injected into global namespace and you can iterate through all objects that have an apiVersion, icon and name .</p>
<p>I tested this out with Nami, Eternl and Lace. All three were detected.</p>
<pre><code>const isBrowser = () =&gt; typeof window !== 'undefined';
var cardano = window.cardano;
if (isBrowser() &amp;&amp; window.cardano &amp;&amp; window.cardano.enable) {
  for (const i in cardano) {
    const wallet = cardano[i];
    if (wallet.apiVersion !== null &amp;&amp; wallet.icon != null &amp;&amp; wallet.name !== null)   {
        // Do something with the 'name' variable here
        console.log(wallet.name);
    }
  }
} 
</code></pre>

CC BY-SA 4.0
2023-07-24T09:51:44.243Z
2023-07-24T09:51:44.243Z
Adam
<p>I am looking for guidance on how I integrate the opportunity for users to select their wallet from a list which is then connected to my page. I have Nami working but when I try call for other wallets they do not seem to function.  the code I am working from is;</p>
<pre><code>&lt;button id=&quot;button&quot; style=&quot;width: 200px; height: 30px;&quot;&gt;
 connect wallet
&lt;/button&gt;
&lt;script&gt;
    var button = document.getElementById(&quot;button&quot;);
    var status = document.getElementById(&quot;Status&quot;);

    async function connectWallet() {
      try {
        await cardano.enable();
        if (typeof window.cardano === &quot;undefined&quot; || typeof window.cardano.nami === &quot;undefined&quot;) {
          throw new Error(&quot;Please install Nami Wallet&quot;);
        } else {
          const api = await window.cardano.nami.enable();
          const addresses = await api.getUsedAddresses();
          console.log(addresses);
        }
      } catch (error) {
        status.innerHTML = error.message;
      }
    }

    button.addEventListener(&quot;click&quot;, connectWallet);
&lt;/script&gt;
</code></pre>
<p>Thanks in advance</p>

<wallet><webapp>
Allowing users to select wallet to connect to website
# Allowing users to select wallet to connect to website

(Asked by: username_0 on 2023-07-22)

I am looking for guidance on how I integrate the opportunity for users to select their wallet from a list which is then connected to my page. I have Nami working but when I try call for other wallets they do not seem to function.  the code I am working from is;

 connect wallet



Thanks in advance

**Tags:** wallet, webapp

---

## 1 answers

### Answer by username_1 on 2023-07-24. Score: 0

If the wallet follows CIP-0030 the cardano object should be injected into global namespace and you can iterate through all objects that have an apiVersion, icon and name .
I tested this out with Nami, Eternl and Lace. All three were detected.
const isBrowser = () => typeof window !== 'undefined';
var cardano = window.cardano;
if (isBrowser() && window.cardano && window.cardano.enable) {
  for (const i in cardano) {
    const wallet = cardano[i];
    if (wallet.apiVersion !== null && wallet.icon != null && wallet.name !== null)   {
        // Do something with the 'name' variable here
        console.log(wallet.name);
    }
  }
}


---

