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

safe-global / safe-client-gateway / 13056140341

30 Jan 2025 03:57PM UTC coverage: 90.809% (-0.08%) from 90.886%
13056140341

push

github

iamacook
feat: add further controller methods

2941 of 3555 branches covered (82.73%)

Branch coverage included in aggregate %.

8 of 18 new or added lines in 3 files covered. (44.44%)

9735 of 10404 relevant lines covered (93.57%)

505.32 hits per line

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

70.59
/src/routes/users/users.controller.ts
1
import { ApiTags } from '@nestjs/swagger';
112✔
2
import {
112✔
3
  Controller,
4
  Delete,
5
  Get,
6
  HttpCode,
7
  HttpStatus,
8
  Param,
9
  Post,
10
  UseGuards,
11
} from '@nestjs/common';
12
import { AuthGuard } from '@/routes/auth/guards/auth.guard';
112✔
13
import { Auth } from '@/routes/auth/decorators/auth.decorator';
112✔
14
import { UsersService } from '@/routes/users/users.service';
112✔
15
import { ValidationPipe } from '@/validation/pipes/validation.pipe';
112✔
16
import { AddressSchema } from '@/validation/entities/schemas/address.schema';
112✔
17
import type { AuthPayload } from '@/domain/auth/entities/auth-payload.entity';
18
import type { UserWithWallets } from '@/routes/users/entities/user-with-wallets.entity';
19
import type { CreatedUserWithWallet } from '@/routes/users/entities/created-user-with-wallet.entity';
20

21
// TODO: Specify error responses for Swagger
22

23
@ApiTags('users')
24
@Controller({ path: 'users', version: '1' })
25
export class UsersController {
112✔
26
  public constructor(private readonly usersService: UsersService) {}
×
27

28
  @HttpCode(HttpStatus.OK)
29
  @Get()
30
  @UseGuards(AuthGuard)
31
  public async getUseWithWallets(
112✔
32
    @Auth() authPayload: AuthPayload,
33
  ): Promise<UserWithWallets> {
NEW
34
    return await this.usersService.getUserWithWallets(authPayload);
×
35
  }
36

37
  @HttpCode(HttpStatus.OK)
38
  @Delete()
39
  @UseGuards(AuthGuard)
40
  public async deleteUser(@Auth() authPayload: AuthPayload): Promise<void> {
112✔
NEW
41
    return await this.usersService.deleteUser(authPayload);
×
42
  }
43

44
  @HttpCode(HttpStatus.OK)
45
  @Post('/wallet')
46
  @UseGuards(AuthGuard)
47
  public async createUserWithWallet(
112✔
48
    @Auth() authPayload: AuthPayload,
49
  ): Promise<CreatedUserWithWallet> {
NEW
50
    return await this.usersService.createUserWithWallet(authPayload);
×
51
  }
52

53
  @HttpCode(HttpStatus.CREATED)
54
  @Delete('/wallet/:walletAddress')
55
  @UseGuards(AuthGuard)
56
  public async deleteWalletFromUser(
112✔
57
    @Param('walletAddress', new ValidationPipe(AddressSchema))
58
    walletAddress: `0x${string}`,
59
    @Auth() authPayload: AuthPayload,
60
  ): Promise<void> {
NEW
61
    return await this.usersService.deleteWalletFromUser({
×
62
      authPayload,
63
      walletAddress,
64
    });
65
  }
66
}
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