Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two more events for EmailOTP #746

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/@magic-sdk/types/src/modules/auth-types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { WalletEventOnReceived } from './wallet-types';

export interface LoginWithMagicLinkConfiguration {
/**
* The email address of the user attempting to login.
Expand Down Expand Up @@ -91,6 +93,8 @@ export type LoginWithEmailOTPEventHandlers = {
[LoginWithEmailOTPEventOnReceived.EmailOTPSent]: () => void;
[LoginWithEmailOTPEventOnReceived.InvalidEmailOtp]: () => void;
[LoginWithEmailOTPEventOnReceived.ExpiredEmailOtp]: () => void;
[AuthEventOnReceived.IDTokenCreated]: (idToken: string) => void;
[WalletEventOnReceived.WalletInfoFetched]: () => void;

// Event sent
[LoginWithEmailOTPEventEmit.VerifyEmailOtp]: (otp: string) => void;
Expand Down Expand Up @@ -205,3 +209,7 @@ export enum UpdateEmailEventOnReceived {
InvalidEmail = 'UpdateEmail/new-email-invalid',
EmailAlreadyExists = 'UpdateEmail/new-email-already-exists',
}

export enum AuthEventOnReceived {
IDTokenCreated = 'Auth/id-token-created',
}
4 changes: 4 additions & 0 deletions packages/@magic-sdk/types/src/modules/wallet-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ export interface GaslessTransactionRequest {
*/
customData?: any;
}

export enum WalletEventOnReceived {
WalletInfoFetched = 'Wallet/wallet-info-fetched',
}