Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Cast Hash Format Between Local and Prod for validateMessage #501

Open
kaushalmeena opened this issue Oct 3, 2024 · 1 comment

Comments

@kaushalmeena
Copy link

Hello,

While validating a frame message via the local debugger's hub endpoint (e.g., http://localhost:3010/hub/v1/validateMessage), the response returns the cast hash in base64 format.

Response:

{
  "data": {
    "type": "MESSAGE_TYPE_FRAME_ACTION",
    "fid": 289309,
    "timestamp": 118494389,
    "network": "FARCASTER_NETWORK_MAINNET",
    "frameActionBody": {
      "url": "aHR0cDovL2xvY2FsaG9zdDozMDAwL21jYS9hY3Rpb24=",
      "buttonIndex": 1,
      "castId": {
        "fid": 16904,
        "hash": "t3mIjAxGlazXdgaZpcJ117ZvEPg="  // Cast hash is base64 encoded
      },
      "inputText": "",
      "state": "",
      "transactionId": "",
      "address": ""
    }
  }
}

However, when using the production hub endpoint (e.g., https://hub-api.neynar.com/v1/validateMessage), the response returns the cast hash as a hexadecimal string.

Response:

{
  "data": {
    "type": "MESSAGE_TYPE_FRAME_ACTION",
    "fid": 8408,
    "timestamp": 100285861,
    "network": "FARCASTER_NETWORK_MAINNET",
    "frameActionBody": {
      "url": "aHR0cDovL2ZyYW1lcy5haXJzdGFjay54eXovYWk=",
      "buttonIndex": 1,
      "castId": {
        "fid": 8408,
        "hash": "0x0000000000000000000000000000000000000001"  // Cast hash is in hex string
      },
      "inputText": "",
      "state": "",
      "transactionId": ""
    }
  }
}

This inconsistency between the local and production endpoints (base64 vs. hexadecimal) causes issues in using cast hash. Could you please clarify if this difference is intentional.

Thank you!

@stephancill
Copy link
Contributor

Hi @kaushalmeena thanks for flagging this. I believe I have seen this issue elsewhere before (https://warpcast.com/stephancill/0xad807ec7), will look into it here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants