diff --git a/src/lib/components/GoogleAuth.svelte b/src/lib/components/GoogleAuth.svelte
index c34f706..53a8c8c 100644
--- a/src/lib/components/GoogleAuth.svelte
+++ b/src/lib/components/GoogleAuth.svelte
@@ -1,11 +1,10 @@
diff --git a/src/lib/services/createLitSession/createLitSession.ts b/src/lib/services/createLitSession/createLitSession.ts
new file mode 100644
index 0000000..f770e5f
--- /dev/null
+++ b/src/lib/services/createLitSession/createLitSession.ts
@@ -0,0 +1,23 @@
+import type { IProvider } from '$lib/services/provider/IProvider';
+import { LitAccessControlConditionResource, LitAbility } from '@lit-protocol/auth-helpers';
+
+export async function createLitSession(
+ provider: IProvider,
+ pkpPublicKey: string,
+ authMethod: any
+): Promise {
+ const litResource = new LitAccessControlConditionResource('*');
+ return await provider.getSessionSigs({
+ pkpPublicKey,
+ authMethod,
+ sessionSigsParams: {
+ chain: 'ethereum',
+ resourceAbilityRequests: [
+ {
+ resource: litResource,
+ ability: LitAbility.PKPSigning
+ }
+ ]
+ }
+ });
+}
diff --git a/src/lib/services/mintPkp/mintPkp.ts b/src/lib/services/mintPkp/mintPkp.ts
new file mode 100644
index 0000000..2f91b7b
--- /dev/null
+++ b/src/lib/services/mintPkp/mintPkp.ts
@@ -0,0 +1,30 @@
+import type { IRelayPKP } from '@lit-protocol/types';
+import type { IProvider } from '$lib/services/provider/IProvider';
+import { createMessage } from '$lib/services/messages';
+
+export async function mintPkp(provider: IProvider, authMethod: any): Promise {
+ createMessage({
+ text: 'Minting started...',
+ sender: '$lib/components/GoogleAuth.svelte',
+ type: 'SYSTEM'
+ });
+
+ const txHash: string = await provider.mintPKPThroughRelayer(authMethod);
+ const response = await provider.relay.pollRequestUntilTerminalState(txHash);
+ if (response.status !== 'Succeeded') {
+ throw new Error('Minting failed');
+ }
+ const newPKP: IRelayPKP = {
+ tokenId: response.pkpTokenId,
+ publicKey: response.pkpPublicKey,
+ ethAddress: response.pkpEthAddress
+ };
+
+ createMessage({
+ text: 'Minted a new PKP.',
+ sender: '$lib/components/GoogleAuth.svelte',
+ type: 'SYSTEM'
+ });
+
+ return newPKP;
+}
diff --git a/src/lib/services/provider/IProvider.ts b/src/lib/services/provider/IProvider.ts
new file mode 100644
index 0000000..76f35ec
--- /dev/null
+++ b/src/lib/services/provider/IProvider.ts
@@ -0,0 +1,6 @@
+export interface IProvider {
+ mintPKPThroughRelayer(authMethod: any): Promise;
+ relay: {
+ pollRequestUntilTerminalState(txHash: string): Promise;
+ };
+}
\ No newline at end of file