Skip to content

Commit

Permalink
Add a sketch for reusing SIWE message
Browse files Browse the repository at this point in the history
  • Loading branch information
manumonti committed Jul 12, 2024
1 parent b689493 commit 918dba7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/taco-auth/src/auth-sig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { z } from 'zod';

import { EIP4361_AUTH_METHOD } from './auth-provider';
import { EIP4361TypedDataSchema } from './providers';
import { SiweMessage } from 'siwe';


export const authSignatureSchema = z.object({
Expand All @@ -13,3 +14,15 @@ export const authSignatureSchema = z.object({
});

export type AuthSignature = z.infer<typeof authSignatureSchema>;

// TODO: create a AuthSignature class.

// TODO: Where do we get the signature from?
export const fromSIWEMessage = (siweMessage: SiweMessage, signature: ???): AuthSignature => {
return {
signature: ???
address: siweMessage.address,
scheme: EIP4361_AUTH_METHOD,
typedData: siweMessage.prepareMessage()
}
}

0 comments on commit 918dba7

Please sign in to comment.