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,24 @@
import { db } from '../config/database';
import { generateUlid } from '../utils/ulid';
export interface WalletRow {
id: string;
user_id: string;
chain: string;
address: string;
derivation_path: string;
created_at: Date;
}
export const WalletModel = {
async findByUserId(userId: string): Promise<WalletRow[]> {
return db('wallets').where({ user_id: userId });
},
async createMany(
wallets: { user_id: string; chain: string; address: string; derivation_path: string }[]
): Promise<WalletRow[]> {
const withIds = wallets.map((w) => ({ id: generateUlid(), ...w }));
return db('wallets').insert(withIds).returning('*');
},
};