update project

This commit is contained in:
ZOMBIIIIIII
2026-04-14 13:30:26 +03:00
parent a81e29807c
commit 37146f7375
65 changed files with 3782 additions and 629 deletions

View File

@@ -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';

View File

@@ -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;
}