user5085: I am working on a light wallet integration. The recommended way of integrating with wallets is defined in CIP30.
When I select Nami and call:
(await api.getUsedAddresses() || await api.getUnusedAddresses() || [])
everything works fine and I receive at least one wallet address - a non empty array. But using the same code for eternl/ ccvault I always receive an empty array.
Is this a missing implementation error on their end or a mistake on my end?
getChangeAddress() works fine for both wallets.
Here some code snippets for more context:
export const isBrowser = () => typeof window !== "undefined";
export type Cardano = {
  [key: string]: {
    name: string;
    icon: string;
    version: string;
    api?: WalletApi,
    enable: () => Promise<WalletApi>;
    isEnabled: () => Promise<boolean>;
  };
};

export const getCardano = (): Cardano | undefined => {
  const cardano = isBrowser() && window.cardano;
  return cardano;
};


and then later in the app:
async (actions, target, { getStoreActions }) => {
      const walletName: string = target.payload;
      const cardano = getCardano()!;
      const api = await cardano[walletName]!.enable();
      const addresses = (await api.getUsedAddresses()
                      || await api.getUnusedAddresses()
                      || []);
{...}



user5085: Thanks to Marcel - founder of eternl I've found my mistake.
await api.getUsedAddresses() actually returns an empty array - I thought both calls return undefined and it defaults to [].
After calling await api.getUsedAddresses() and await api.getUnusedAddresses() separately they both work as expected since my test wallet currently does not have used addresses.

5085: <p>I am working on a light wallet integration. The recommended way of integrating with wallets is defined in CIP30.</p>
<p>When I select Nami and call:
<code>(await api.getUsedAddresses() || await api.getUnusedAddresses() || [])</code>
everything works fine and I receive at least one wallet address - a non empty array. But using the same code for eternl/ ccvault I always receive an empty array.</p>
<p>Is this a missing implementation error on their end or a mistake on my end?
<code>getChangeAddress()</code> works fine for both wallets.</p>
<p>Here some code snippets for more context:</p>
<pre><code>export const isBrowser = () =&gt; typeof window !== &quot;undefined&quot;;
export type Cardano = {
  [key: string]: {
    name: string;
    icon: string;
    version: string;
    api?: WalletApi,
    enable: () =&gt; Promise&lt;WalletApi&gt;;
    isEnabled: () =&gt; Promise&lt;boolean&gt;;
  };
};

export const getCardano = (): Cardano | undefined =&gt; {
  const cardano = isBrowser() &amp;&amp; window.cardano;
  return cardano;
};

</code></pre>
<p>and then later in the app:</p>
<pre><code>async (actions, target, { getStoreActions }) =&gt; {
      const walletName: string = target.payload;
      const cardano = getCardano()!;
      const api = await cardano[walletName]!.enable();
      const addresses = (await api.getUsedAddresses()
                      || await api.getUnusedAddresses()
                      || []);
{...}

</code></pre>
 5085: <p>Thanks to Marcel - founder of eternl I've found my mistake.</p>
<p><code>await api.getUsedAddresses()</code> actually returns an empty array - I thought both calls return <code>undefined</code> and it defaults to <code>[]</code>.</p>
<p>After calling <code>await api.getUsedAddresses()</code> and <code>await api.getUnusedAddresses()</code> separately they both work as expected since my test wallet currently does not have used addresses.</p>
