Skip to content

Commit

Permalink
Update Client functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreyaschorge committed Nov 13, 2023
1 parent 221e6a2 commit ccbe0b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
8 changes: 3 additions & 5 deletions src/neynar-api/neynar-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,11 @@ export class NeynarAPIClient {
/**
* Gets information about an array of casts.
* See [Neynar documentation](https://docs.neynar.com/reference/casts)
* @param casts - Cast hashes (Comma Separated)
*
*/
public async fetchBulkCastsByHash(
casts: string,
castHashes: string[]
): Promise<CastsResponse> {
return await this.clients.v2.fetchBulkCastsByHash(casts, castHashes);
public async fetchBulkCastsByHash(casts: string): Promise<CastsResponse> {
return await this.clients.v2.fetchBulkCastsByHash(casts);
}

/**
Expand Down
14 changes: 2 additions & 12 deletions src/neynar-api/neynar-v2-api/neynar-api-v2-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class NeynarV2APIClient {
basePath: basePath ? `${basePath}/v2` : BASE_PATH,
apiKey: apiKey,
});

this.apis = {
signer: new SignerApi(config, undefined, axiosInstance),
user: new UserApi(config, undefined, axiosInstance),
Expand Down Expand Up @@ -343,19 +343,9 @@ export class NeynarV2APIClient {
* See [Neynar documentation](https://docs.neynar.com/reference/casts)
*
*/
public async fetchBulkCastsByHash(
casts: string,
castHashes?: string[]
): Promise<CastsResponse> {
public async fetchBulkCastsByHash(casts: string): Promise<CastsResponse> {
const response = await this.apis.cast.casts({
casts,
...(castHashes
? {
getCastsReqBody: {
casts: castHashes.map((hash) => ({ hash })),
},
}
: {}),
});
return response.data;
}
Expand Down

0 comments on commit ccbe0b6

Please sign in to comment.