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

Add methods for unimplimented Neynar V2 endpoints #720

Open
piratekev opened this issue Nov 22, 2023 · 0 comments
Open

Add methods for unimplimented Neynar V2 endpoints #720

piratekev opened this issue Nov 22, 2023 · 0 comments

Comments

@piratekev
Copy link
Collaborator

Describe the solution you'd like
The latest Neynar V2 spec includes the following new endpoints:

GET /farcaster/user/bulk
POST & DELETE /farcaster/user/verification
GET /farcaster/user/custody-address
GET /farcaster/notifications
GET /farcaster/followers/relevant

Implement methods to expose the functionality of these endpoints. The following methods should be implemented in the Neynar V2 client and have tests added:

getUsers(fids: string[])
addVerification(signerUuid: string, address: string, blockHash: string, ethSignature: string)
deleteVerification(signerUuid: string, address: string, blockHash: string, ethSignature: string)
getUserByVerificationAddress(address: string)
getUserNotifications(fid: string)
getUserRelevantFollowers(targetFid: string, viewerFid: string)

Additional context
For the new verification methods, it's worth looking into abstracting away signing the message from the user, similar to what's done in the hub-rest package for signing verifications.

The Neynar V2 spec can be found here: neynarxyz/OAS/blob/main/src/v2/spec.yaml.

There are some manual steps to clean up the spec so that it works for us:

  1. Delete the Parameter ApiKey everywhere it occurs
  2. Replace the security and securitySchemes blocks in the swagger. The first 20 lines of the file should look like this:
openapi: 3.0.0
info:
  title: Farcaster API V2
  version: "2.0"
servers:
  - url: https://api.neynar.com/v2
security:
  - ApiKeyAuth: []

components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: API key required for authentication. use value --> NEYNAR_API_DOCS<-- for testing
  schemas:
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

1 participant