farcasterxyz / hub-monorepo

Implementation of the Farcaster Hub specification and supporting libraries for building applications on Farcaster
https://www.thehubble.xyz
MIT License
697 stars 390 forks source link

Phrase key import problem #2054

Closed majin567 closed 3 months ago

majin567 commented 3 months ago

What is the bug? A concise, high level description of the bug and how it affects you

How can it be reproduced? (optional) Include steps, code samples, replits, screenshots and anything else that would be helpful to reproduce the problem.

Additional context (optional) Add any other context about the problem here.

I am importing 12 words phrases and then I face this problem

{ "error": "\n######################################################################\n\nHandledFetchError\n...message: getOnboardingState 403 - No active Warpcast signer exists for FID undefined\n...name: Farcaster API Error\n...absoluteUrl: https://client.warpcast.com/v2/onboarding-state\n...body: undefined\n...endpointName: getOnboardingState\n...hasTimedOut: false\n...isNetworkError: false\n...method: GET\n...relativeUrl: /v2/onboarding-state\n...resolvedTimeout: 20000\n...response: [object Object]\n...responseData: [object Object]\n...status: 403\n...timeout: undefined\n\n######################################################################\n", "localTimestamp": 1718348604371, "unauthed": true }

The error message indicates that the API request to https://client.warpcast.com/v2/onboarding-state was rejected with a 403 Forbidden status. The key points from the error are:

  1. 403 Forbidden: The server understood the request but refuses to authorize it. This typically indicates a permission issue.
  2. No active Warpcast signer exists for FID undefined: This suggests that the request did not include a valid identifier (FID) for the Warpcast signer.
  3. Unauthed: The request appears to lack proper authentication credentials.

Potential Causes and Solutions

  1. Missing or Incorrect Authentication: Ensure that the API request includes the correct authentication credentials. If an API key or token is required, it must be provided and valid.

  2. Invalid or Missing FID: The request should include a valid FID (Farcaster ID) for the signer. Check if the FID is being correctly set in the request parameters or headers.

  3. API Access Permissions: Verify that the account making the request has the necessary permissions to access the onboarding-state endpoint.

Steps to Troubleshoot

  1. Check Authentication: Make sure that the authentication method (e.g., API key, OAuth token) is correctly implemented and the credentials are up-to-date.

    • If using an API key, ensure it is passed in the headers.
    • If using OAuth, verify that the token is valid and has not expired.
  2. Verify FID: Ensure that the FID is being correctly set and passed in the request. This might involve:

    • Checking the code to see how the FID is being retrieved and included in the request.
    • Confirming that the FID exists and is active.
  3. Review API Documentation: Check the API documentation for any specific requirements or changes in the endpoint that might affect the request.

  4. Contact Support: If the issue persists, consider reaching out to the support team for the API provider with the details of the error message.

Here is an example of how you might structure the API request to include the necessary authentication and parameters:

const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://client.warpcast.com/v2/onboarding-state',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN', // Replace with actual token
    'Content-Type': 'application/json'
  },
  params: {
    'fid': 'YOUR_FID' // Replace with actual FID
  }
};

axios(options)
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error.response ? error.response.data : error.message);
  });

Make sure to replace YOUR_API_TOKEN and YOUR_FID with the actual values.

You're encountering an error while importing a 12-word recovery phrase. Here's a brief troubleshooting guide:

Possible Issues and Solutions

  1. Invalid Recovery Phrase:

    • Ensure the 12-word phrase is entered correctly and in the right order.
  2. Incorrect API Request:

    • Verify the request format and ensure all required fields are included.
  3. Authentication Issue:

    • Make sure you're using the correct API keys or tokens.

Steps to Fix

  1. Verify Recovery Phrase:

    • Double-check the 12-word phrase for correctness and order.
  2. Check API Request:

    • Format the request correctly. Example:

      const axios = require('axios');
      
      const options = {
      method: 'POST',
      url: 'https://client.warpcast.com/v2/import-key',
      headers: {
       'Authorization': 'Bearer YOUR_API_TOKEN', // Replace with actual token
       'Content-Type': 'application/json'
      },
      data: {
       'recoveryPhrase': 'your twelve word phrase here' // Replace with actual phrase
      }
      };
      
      axios(options)
      .then(response => {
       console.log(response.data);
      })
      .catch(error => {
       console.error(error.response ? error.response.data : error.message);
      });
  3. Authentication:

    • Ensure your authentication credentials are correct and up-to-date. Screenshot_20240614-124301
sds commented 3 months ago

Hey @majin567, looks like you're using Warpcast. Please use the support channel provided in the app. This repository is for the Farcaster project, not Warpcast. Thanks!