feat: deprecates v1 fetchAllCastsCreatedByUser (in favor of v2's fetchCastsForUser)
Minor update: v1.47.0
Test Plan
Tested by writing a and running a script
(async () => {
console.log('Trying out client.fetchCastsForUser');
try {
const res = await client.fetchCastsForUser(3, {});
// Stringify and log the response
console.log('Got your response: ')
console.log(JSON.stringify(res));
// Also works fine with optional params
const res2 = await client.fetchCastsForUser(
3,
{
limit: 2,
cursor: 'eyJ0aW1lc3RhbXAiOiIyMDI0LTA4LTIwIDE5OjQyOjU3LjAwMDAwMDAifQ%3D%3D',
includeReplies: false,
}
);
console.log('Got your second response: ')
console.log(JSON.stringify(res));
console.log('Num results: ', res2.casts.length);
} catch (error) {
// isApiErrorResponse can be used to check for Neynar API errors
if (NeynarV2APIClient.isApiErrorResponse(error)) {
console.log("API Error", (error as any).response.data);
} else {
console.log("Generic Error", error);
}
}
console.log('gn');
})();
Included Changes
fetchCastsForUser
methodfetchAllCastsCreatedByUser
(in favor of v2'sfetchCastsForUser
)Test Plan
Tested by writing a and running a script