<p>The first error happens because there are no transactions for the address you try to query on the blockchain. If the address was never used, this endpoint returns a 404 error.</p>
<p>The second error seems to happen because you pass in 'undefined' instead of an actual stake key when building the URL.</p>

CC BY-SA 4.0
2022-11-04T15:05:28.517Z
2022-11-04T15:05:28.517Z
eddex
<p><a href="https://i.sstatic.net/tqO56.png" rel="nofollow noreferrer">This is a screenshot of console log for my problem</a></p>
<pre class="lang-typescript prettyprint-override"><code>    export const deriveStakeAddress = async ( rewardAddress: string ): 
       Promise&lt;string&gt; =&gt; {  
    
           const endPoint = `addresses/${rewardAddress}`;
           const request: string = 'https://cardano-mainnet.blockfrost.io/api/v0/' + endPoint    
           console.log(&quot;Request:&quot;, request);
           const response = await fetch(request, {
             //@ts-ignore
             headers: {
                &quot;Content-Type&quot;: &quot;application/json&quot;,
                 project_id: process.env.REACT_APP_BLOCKFROST_KEY      
             },
             method: &quot;GET&quot;,
          });
          const result = await response.json();
          console.log(&quot;Stake address: &quot;, result);
          return result.stake_address;
       };
    
    export const findAssets = async (networkId: number, stakeAddress: string) =&gt; 
         {
    
          const endPoint = `accounts/${stakeAddress}/addresses/assets`;
          const request: string = 'https://cardano-mainnet.blockfrost.io/api/v0/' + endPoint; 
          console.log(&quot;Request:&quot;, request);
          const response = await fetch(request, {
             //@ts-ignore
             headers: {
                &quot;Content-Type&quot;: &quot;application/json&quot;,
                 project_id: process.env.REACT_APP_BLOCKFROST_KEY      
             },
             method: &quot;GET&quot;,
          });
          const result = await response.json();
          console.log(&quot;Assets: &quot;, result);
          return result;  
    };
</code></pre>
<p>And then I called above functions as following.</p>
<pre class="lang-typescript prettyprint-override"><code>const walletAddress: string = 'addr1qxzpuc....6vexzc';
const stakeAddress: string = await deriveStakeAddress( walletAddress );
const assets = await findAssets( stakeAddress );
</code></pre>
<p><em>But I faced errors for some wallets such as <strong>Yoroi, Eternl</strong>.</em></p>
<p>On the other hand, there was no errors for Nami wallet. (<a href="https://i.sstatic.net/dX3uA.png" rel="nofollow noreferrer">here</a>)</p>

<blockfrost>
Error occurs in simple request to blockfrost.io for multiple wallets
# Error occurs in simple request to blockfrost.io for multiple wallets

(Asked by: username_0 on 2022-11-04)

This is a screenshot of console log for my problem
    export const deriveStakeAddress = async ( rewardAddress: string ): 
       Promise => {  
    
           const endPoint = `addresses/${rewardAddress}`;
           const request: string = 'https://cardano-mainnet.blockfrost.io/api/v0/' + endPoint    
           console.log("Request:", request);
           const response = await fetch(request, {
             //@ts-ignore
             headers: {
                "Content-Type": "application/json",
                 project_id: process.env.REACT_APP_BLOCKFROST_KEY      
             },
             method: "GET",
          });
          const result = await response.json();
          console.log("Stake address: ", result);
          return result.stake_address;
       };
    
    export const findAssets = async (networkId: number, stakeAddress: string) => 
         {
    
          const endPoint = `accounts/${stakeAddress}/addresses/assets`;
          const request: string = 'https://cardano-mainnet.blockfrost.io/api/v0/' + endPoint; 
          console.log("Request:", request);
          const response = await fetch(request, {
             //@ts-ignore
             headers: {
                "Content-Type": "application/json",
                 project_id: process.env.REACT_APP_BLOCKFROST_KEY      
             },
             method: "GET",
          });
          const result = await response.json();
          console.log("Assets: ", result);
          return result;  
    };

And then I called above functions as following.
const walletAddress: string = 'addr1qxzpuc....6vexzc';
const stakeAddress: string = await deriveStakeAddress( walletAddress );
const assets = await findAssets( stakeAddress );

But I faced errors for some wallets such as Yoroi, Eternl.
On the other hand, there was no errors for Nami wallet. (here)

**Tags:** blockfrost

---

## 1 answers

### Answer by username_1 on 2022-11-04. Score: 1

The first error happens because there are no transactions for the address you try to query on the blockchain. If the address was never used, this endpoint returns a 404 error.

The second error seems to happen because you pass in 'undefined' instead of an actual stake key when building the URL.


---

