@lit-protocol/e2e
Version:
Lit Protocol E2E testing package for running comprehensive integration tests
105 lines (104 loc) • 4.37 kB
TypeScript
import { init } from '../init';
/**
* Creates a PKP authentication context with pre-generated session materials
* This simulates a server-side use case where session key pair and delegation
* signature are generated once and reused for multiple requests
*/
export declare const createPkpAuthContextWithPreGeneratedMaterials: (ctx: Awaited<ReturnType<typeof init>>) => Promise<{
chain: string;
pkpPublicKey: string;
authData: {
authMethodType: 1 | 2 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13;
accessToken: string;
authMethodId: string;
publicKey?: string | undefined;
metadata?: any;
};
authConfig: {
domain: string;
resources: {
resource: {
toString: (...args: unknown[]) => string;
getResourceKey: (...args: unknown[]) => string;
isValidLitAbility: (args_0: "access-control-condition-decryption" | "access-control-condition-signing" | "pkp-signing" | "lit-payment-delegation" | "lit-action-execution", ...args: unknown[]) => boolean;
resourcePrefix: "lit-accesscontrolcondition" | "lit-pkp" | "lit-ratelimitincrease" | "lit-paymentdelegation" | "lit-litaction";
resource: string;
};
ability: "access-control-condition-decryption" | "access-control-condition-signing" | "pkp-signing" | "lit-payment-delegation" | "lit-action-execution";
data?: Record<string, import("dist/packages/schemas/src").DefinedJson> | undefined;
}[];
capabilityAuthSigs: never[];
expiration: string;
statement: string;
};
sessionKeyPair: {
publicKey: string;
secretKey: string;
};
derivedAuthMetadata: {
authMethodType: 1 | 2 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13;
accessToken: string;
authMethodId: string;
publicKey?: string | undefined;
metadata?: any;
} | undefined;
authNeededCallback: () => Promise<{
sig: string;
derivedVia: string;
signedMessage: string;
address: string;
algo?: string | undefined;
}>;
}>;
/**
* Creates a PKP authentication context
*/
export declare const createPkpAuthContext: (ctx: Awaited<ReturnType<typeof init>>) => Promise<any>;
/**
* Creates a custom authentication context
*/
export declare const createCustomAuthContext: (ctx: Awaited<ReturnType<typeof init>>) => Promise<any>;
/**
* Creates an EOA authentication context with pre-generated session materials
* This demonstrates how to pre-generate EOA session materials for server-side use
*/
export declare const createEoaAuthContextWithPreGeneratedMaterials: (ctx: Awaited<ReturnType<typeof init>>) => Promise<{
sessionKeyPair: {
publicKey: string;
secretKey: string;
};
authNeededCallback: (...args: unknown[]) => unknown;
authConfig: {
capabilityAuthSigs: {
sig: string;
derivedVia: string;
signedMessage: string;
address: string;
algo?: string | undefined;
}[];
expiration: string;
statement: string;
domain: string;
resources: {
resource: {
toString: (...args: unknown[]) => string;
getResourceKey: (...args: unknown[]) => string;
isValidLitAbility: (args_0: "access-control-condition-decryption" | "access-control-condition-signing" | "pkp-signing" | "lit-payment-delegation" | "lit-action-execution", ...args: unknown[]) => boolean;
resourcePrefix: "lit-accesscontrolcondition" | "lit-pkp" | "lit-ratelimitincrease" | "lit-paymentdelegation" | "lit-litaction";
resource: string;
};
ability: "access-control-condition-decryption" | "access-control-condition-signing" | "pkp-signing" | "lit-payment-delegation" | "lit-action-execution";
data?: Record<string, import("dist/packages/schemas/src").DefinedJson> | undefined;
}[];
keySetIdentifier?: string | undefined;
};
authData: {
authMethodType: 1 | 2 | 4 | 3 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13;
accessToken: string;
authMethodId: string;
publicKey?: string | undefined;
metadata?: any;
};
account?: any;
authenticator?: any;
}>;