Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
robpolak-cb committed Jan 29, 2024
1 parent 2cf5ea3 commit a654fba
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/core/getFrameAccountAddress.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getFrameAccountAddress } from './getFrameAccountAddress';
import { mockNeynarResponse } from './mock';
import {neynarBulkUserLookup} from "../utils/neynar/user/neynarUserFunctions";
import { neynarBulkUserLookup } from '../utils/neynar/user/neynarUserFunctions';

jest.mock('../utils/neynar/user/neynarUserFunctions', () => {
return {
neynarBulkUserLookup: jest.fn()
neynarBulkUserLookup: jest.fn(),
};
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/getFrameAccountAddress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getFrameValidatedMessage } from './getFrameValidatedMessage';
import {neynarBulkUserLookup} from "../utils/neynar/user/neynarUserFunctions";
import { neynarBulkUserLookup } from '../utils/neynar/user/neynarUserFunctions';

type FidResponse = {
verifications: string[];
Expand Down
4 changes: 2 additions & 2 deletions src/core/getFrameValidatedMessage.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { mockNeynarResponse } from './mock';
import { getFrameValidatedMessage } from './getFrameValidatedMessage';
import {neynarBulkUserLookup} from "../utils/neynar/user/neynarUserFunctions";
import { neynarBulkUserLookup } from '../utils/neynar/user/neynarUserFunctions';

jest.mock('../utils/neynar/user/neynarUserFunctions', () => {
return {
neynarBulkUserLookup: jest.fn()
neynarBulkUserLookup: jest.fn(),
};
});

Expand Down
3 changes: 1 addition & 2 deletions src/utils/neynar/neynar.integ.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

import {neynarBulkUserLookup} from "./user/neynarUserFunctions";
import { neynarBulkUserLookup } from './user/neynarUserFunctions';

describe('integration tests', () => {
it('bulk data lookup should find all users', async () => {
Expand Down
3 changes: 1 addition & 2 deletions src/utils/neynar/user/neynarUserFunctions.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { FetchError } from '../exceptions/FetchError';
import {neynarBulkUserLookup} from "./neynarUserFunctions";

import { neynarBulkUserLookup } from './neynarUserFunctions';

describe('neynar user functions', () => {
let fetchMock = jest.fn();
Expand Down
9 changes: 6 additions & 3 deletions src/utils/neynar/user/neynarUserFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FetchError } from '../exceptions/FetchError';

export const NEYNAR_DEFAULT_API_KEY = "NEYNAR_API_DOCS";
export const NEYNAR_DEFAULT_API_KEY = 'NEYNAR_API_DOCS';
export interface NeynarUserModel {
fid: number;
custody_address: string;
Expand All @@ -19,7 +19,10 @@ export interface NeynarBulkUserLookupModel {
users: NeynarUserModel[];
}

export async function neynarBulkUserLookup(farcasterIDs: number[], apiKey: string = NEYNAR_DEFAULT_API_KEY): Promise<NeynarBulkUserLookupModel | undefined> {
export async function neynarBulkUserLookup(
farcasterIDs: number[],
apiKey: string = NEYNAR_DEFAULT_API_KEY,
): Promise<NeynarBulkUserLookupModel | undefined> {
const options = {
method: 'GET',
url: `https://api.neynar.com/v2/farcaster/user/bulk?fids=${farcasterIDs.join(',')}`,
Expand Down Expand Up @@ -70,4 +73,4 @@ function convertToNeynarUserModel(data: any): NeynarUserModel | undefined {
follower_count: data.follower_count ?? 0,
verifications: Array.isArray(data.verifications) ? data.verifications : [],
};
}
}

0 comments on commit a654fba

Please sign in to comment.