add project

This commit is contained in:
ZOMBIIIIIII
2026-04-08 14:11:27 +03:00
parent bfa95223a0
commit a81e29807c
115 changed files with 18413 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
{
"name": "@cryptowallet/shared",
"version": "0.1.0",
"private": true,
"main": "./src/index.ts",
"types": "./src/index.ts",
"scripts": {
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"typescript": "^5.6.0"
}
}

View File

@@ -0,0 +1,9 @@
export const CHAINS = ['ETH', 'BTC', 'SOL', 'TRX'] as const;
export type Chain = (typeof CHAINS)[number];
export const DERIVATION_PATHS: Record<Chain, string> = {
ETH: "m/44'/60'/0'/0/0",
BTC: "m/84'/0'/0'/0/0",
SOL: "m/44'/501'/0'/0'",
TRX: "m/44'/195'/0'/0/0",
};

View File

@@ -0,0 +1,3 @@
export { CHAINS, DERIVATION_PATHS } from './constants/chains';
export type { Chain } from './constants/chains';
export type { ApiResponse, AccessTokenPayload, AuthContext } from './types/auth';

View File

@@ -0,0 +1,22 @@
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;
}

View File

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"declaration": true
},
"include": ["src/**/*"]
}