UNPKG

@lit-protocol/e2e

Version:

Lit Protocol E2E testing package for running comprehensive integration tests

32 lines 1.37 kB
import { ViemAccountAuthenticator } from '@lit-protocol/auth'; export const createViewPKPsByAuthDataTest = (ctx, getAuthContext, authData) => { return async () => { const _authData = authData || (await ViemAccountAuthenticator.authenticate(ctx.aliceViemAccount)); const pkps = await ctx.litClient.viewPKPsByAuthData({ authData: { authMethodType: _authData.authMethodType, authMethodId: _authData.authMethodId, accessToken: _authData.accessToken || 'mock-token', }, pagination: { limit: 10, offset: 0, }, }); expect(pkps).toBeDefined(); expect(pkps.pkps).toBeDefined(); expect(Array.isArray(pkps.pkps)).toBe(true); expect(pkps.pagination).toBeDefined(); expect(typeof pkps.pagination.total).toBe('number'); expect(typeof pkps.pagination.hasMore).toBe('boolean'); // Should find at least the PKP we created in init expect(pkps.pkps.length).toBeGreaterThan(0); // Verify the PKP structure const firstPkp = pkps.pkps[0]; expect(firstPkp.tokenId).toBeDefined(); expect(firstPkp.pubkey).toBeDefined(); expect(firstPkp.ethAddress).toBeDefined(); }; }; //# sourceMappingURL=view-pkps-by-auth-data.js.map