neynarxyz / nodejs-sdk

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

User.verified_addresses not part of interface #75

Closed eucalyptus-viminalis closed 6 months ago

eucalyptus-viminalis commented 6 months ago

verified_addresses is not part of the User interface.

Reproduce

Typescript code

    ...
    const data = await neynar.fetchBulkUsers([fid], {
        // viewerFid,
    })
    const user: User | undefined = data.users.at(0)
    if (user === undefined) {
        throw new Error('fetchBulkUsers failed for fid: ' + fid)
    }
    console.log('user', user)
    ...

Intellisense

image

User object using NeynarAPIClient.fetchBulkUsers

image

Checking various User types that are part of the SDK, we see that verified_addresses is not part of the User interface.

Additional discussion

Is is possible to narrow the export scope for types in the SDK? Problem with this is that I'm not sure if the XYZ type/interface have the same shape in all the different files that export the same symbol name. This could lead developers to sink time in checking all the different exported symbols to verify if they're importing the wrong thing.

E.g. If I try to import SomeType in VSCode using "Quick Fix," I'm overwhelmed by exports from many different files.

VSCode Quick Fix

image
Shreyaschorge commented 6 months ago

@eucalyptus-viminalis

Thanks for reporting.

verified_addresses is now a part of the User interface. https://github.com/neynarxyz/nodejs-sdk/releases/tag/v1.11.1

Also added a ticket for centralizing exports in the backlog. I'll revisit this once I get some room.

Marking this issue as closed feel free to re-open this if needed or create another one.