• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-client-gateway / 12790184723

15 Jan 2025 02:14PM UTC coverage: 91.022% (-0.08%) from 91.103%
12790184723

Pull #2264

github

web-flow
Merge 42b0335eb into 258017619
Pull Request #2264: Add `wallet` entity

2936 of 3549 branches covered (82.73%)

Branch coverage included in aggregate %.

0 of 18 new or added lines in 1 file covered. (0.0%)

9797 of 10440 relevant lines covered (93.84%)

473.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/datasources/users/entities/wallets.entity.db.ts
NEW
1
import { RowSchema } from '@/datasources/db/v1/entities/row.entity';
×
NEW
2
import { UuidSchema } from '@/validation/entities/schemas/uuid.schema';
×
3
import type { UUID } from 'crypto';
NEW
4
import {
×
5
  Column,
6
  Entity,
7
  Unique,
8
  PrimaryGeneratedColumn,
9
  ManyToOne,
10
} from 'typeorm';
11
import { z } from 'zod';
NEW
12
import { getAddress } from 'viem';
×
NEW
13
import { AddressSchema } from '@/validation/entities/schemas/address.schema';
×
NEW
14
import { User } from '@/datasources/users/entities/users.entity.db';
×
15

NEW
16
export const WalletSchema = RowSchema.extend({
×
17
  id: UuidSchema,
18
  user_id: UuidSchema,
19
  address: AddressSchema,
20
});
21

22
@Entity('wallets')
23
@Unique('id', ['id'])
NEW
24
export class Wallet implements z.infer<typeof WalletSchema> {
×
25
  @PrimaryGeneratedColumn('uuid')
NEW
26
  id!: UUID;
×
27

28
  @Column({ type: 'uuid' })
NEW
29
  @ManyToOne(() => User, (user) => user.id, {
×
30
    onDelete: 'CASCADE',
31
  })
NEW
32
  user_id!: UUID;
×
33

34
  @Column({
35
    type: 'varchar',
36
    length: 42,
37
    transformer: {
38
      from(value: string): `0x${string}` {
NEW
39
        return getAddress(value);
×
40
      },
41
      to(value: string): `0x${string}` {
NEW
42
        return getAddress(value);
×
43
      },
44
    },
45
  })
NEW
46
  address!: `0x${string}`;
×
47

48
  @Column({
49
    type: 'timestamp with time zone',
NEW
50
    default: () => 'CURRENT_TIMESTAMP',
×
51
  })
NEW
52
  created_at!: Date;
×
53

54
  @Column({
55
    type: 'timestamp with time zone',
NEW
56
    default: () => 'CURRENT_TIMESTAMP',
×
57
    onUpdate: 'CURRENT_TIMESTAMP',
58
  })
NEW
59
  updated_at!: Date;
×
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc