neynarxyz / nodejs-sdk

Typescript SDK for Neynar APIs
https://neynar.com
MIT License
53 stars 11 forks source link

feat: add `fetchBlockList` method to fetch who's blocking who #170

Closed valerierose closed 2 months ago

valerierose commented 2 months ago

Overview

Adds the fetchBlockList method which can fetch a list of who's blocking who. A list of blocked users can be pulled by providing a blocker_fid or a list of users who blocked someone by providing the blocked_fid

Example

# index.js
const result = await client.fetchBlockList({blockerFid: 419871})

// Stringify and log the response
console.log(JSON.stringify(result));
$ node index.js | jq
{
  "blocks": [
    {
      "object": "block",
      "blocked": {
        "object": "user",
        "fid": 499008,
        "custody_address": "0x9744fda1e8cd653b7c15f4f2f1da541ca91f3699",
        "username": "ronnie-coleman",
        "display_name": "WieheißtduHastdugegessenttkkwwp",
        "pfp_url": "https://imagedelivery.net/BXluQx4ige9GuW0Ia56BHw/4594bb85-4ff1-4840-387b-495b6f8dbf00/rectcrop3",
        "profile": {
          "bio": {
            "text": "Eng"
          }
        },
        "follower_count": 4823,
        "following_count": 4061,
        "verifications": [
          "0x90b53660bd66d2b88587b0785bb43d032d917ccf",
          "0x3dd1dfb2f0533ed4c54d17915889d18e8bf871bf"
        ],
        "verified_addresses": {
          "eth_addresses": [
            "0x90b53660bd66d2b88587b0785bb43d032d917ccf",
            "0x3dd1dfb2f0533ed4c54d17915889d18e8bf871bf"
          ],
          "sol_addresses": []
        },
        "active_status": "inactive",
        "power_badge": false
      },
      "blocked_at": "2024-09-04T14:41:20.000Z"
    }
  ],
  "next": {
    "cursor": null
  }
}
manan19 commented 2 months ago

@valerierose looks good. let's bump the SDK version