update project
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
export { CHAINS, DERIVATION_PATHS } from './constants/chains';
|
||||
export type { Chain } from './constants/chains';
|
||||
export type { ApiResponse, AccessTokenPayload, AuthContext } from './types/auth';
|
||||
export type { RegisterRequest, LoginRequest, AuthResponse, ApiResponse } from './types/auth';
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
import { Chain } from '../constants/chains';
|
||||
|
||||
export interface RegisterRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
pin: string;
|
||||
encryptedVault: string;
|
||||
vaultSalt: string;
|
||||
wallets: { chain: Chain; address: string; derivationPath: string }[];
|
||||
}
|
||||
|
||||
export interface LoginRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
pin: string;
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
accessToken: string;
|
||||
user: { id: string; username: string };
|
||||
encryptedVault?: string;
|
||||
vaultSalt?: string;
|
||||
wallets?: { chain: Chain; address: string; derivationPath: string }[];
|
||||
mnemonicShown: boolean;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T = unknown> {
|
||||
success: boolean;
|
||||
data?: T;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface AccessTokenPayload {
|
||||
sub: string;
|
||||
type: string;
|
||||
sid: string;
|
||||
iat: number;
|
||||
nbf: number;
|
||||
exp: number;
|
||||
iss?: string;
|
||||
aud?: string;
|
||||
}
|
||||
|
||||
export interface AuthContext {
|
||||
userId: string;
|
||||
sid: string;
|
||||
token: AccessTokenPayload;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user