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

safe-global / safe-client-gateway / 11340871916

15 Oct 2024 06:58AM UTC coverage: 46.83% (-45.0%) from 91.836%
11340871916

push

github

web-flow
Bump typescript from 5.6.2 to 5.6.3 (#2015)

Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.6.2 to 5.6.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.6.2...v5.6.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

500 of 3096 branches covered (16.15%)

Branch coverage included in aggregate %.

5092 of 8845 relevant lines covered (57.57%)

12.16 hits per line

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

18.37
/src/datasources/locking-api/locking-api.service.ts
1
import { IConfigurationService } from '@/config/configuration.service.interface';
16✔
2
import { HttpErrorFactory } from '@/datasources/errors/http-error-factory';
16✔
3
import {
16✔
4
  NetworkService,
5
  INetworkService,
6
} from '@/datasources/network/network.service.interface';
7
import { Page } from '@/domain/entities/page.entity';
8
import { ILockingApi } from '@/domain/interfaces/locking-api.interface';
9
import { Campaign } from '@/domain/community/entities/campaign.entity';
10
import { CampaignRank } from '@/domain/community/entities/campaign-rank.entity';
11
import { LockingEvent } from '@/domain/community/entities/locking-event.entity';
12
import { LockingRank } from '@/domain/community/entities/locking-rank.entity';
13
import { Inject } from '@nestjs/common';
16✔
14

15
export class LockingApi implements ILockingApi {
16✔
16
  private readonly baseUri: string;
17

18
  constructor(
19
    @Inject(IConfigurationService)
20
    private readonly configurationService: IConfigurationService,
16✔
21
    @Inject(NetworkService)
22
    private readonly networkService: INetworkService,
16✔
23
    private readonly httpErrorFactory: HttpErrorFactory,
16✔
24
  ) {
25
    this.baseUri =
16✔
26
      this.configurationService.getOrThrow<string>('locking.baseUri');
27
  }
28

29
  async getCampaignById(resourceId: string): Promise<Campaign> {
30
    try {
×
31
      const url = `${this.baseUri}/api/v1/campaigns/${resourceId}`;
×
32
      const { data } = await this.networkService.get<Campaign>({ url });
×
33
      return data;
×
34
    } catch (error) {
35
      throw this.httpErrorFactory.from(error);
×
36
    }
37
  }
38

39
  async getCampaigns(args: {
40
    limit?: number;
41
    offset?: number;
42
  }): Promise<Page<Campaign>> {
43
    try {
×
44
      const url = `${this.baseUri}/api/v1/campaigns`;
×
45
      const { data } = await this.networkService.get<Page<Campaign>>({
×
46
        url,
47
        networkRequest: {
48
          params: {
49
            limit: args.limit,
50
            offset: args.offset,
51
          },
52
        },
53
      });
54
      return data;
×
55
    } catch (error) {
56
      throw this.httpErrorFactory.from(error);
×
57
    }
58
  }
59

60
  async getCampaignActivities(args: {
61
    resourceId: string;
62
    holder?: `0x${string}`;
63
    limit?: number;
64
    offset?: number;
65
  }): Promise<number> {
66
    try {
×
67
      const url = `${this.baseUri}/api/v1/campaigns/${args.resourceId}/activities`;
×
68
      const { data } = await this.networkService.get<number>({
×
69
        url,
70
        networkRequest: {
71
          params: {
72
            holder: args.holder,
73
            limit: args.limit,
74
            offset: args.offset,
75
          },
76
        },
77
      });
78
      return data;
×
79
    } catch (error) {
80
      throw this.httpErrorFactory.from(error);
×
81
    }
82
  }
83

84
  async getCampaignRank(args: {
85
    resourceId: string;
86
    safeAddress: `0x${string}`;
87
  }): Promise<CampaignRank> {
88
    try {
×
89
      const url = `${this.baseUri}/api/v1/campaigns/${args.resourceId}/leaderboard/${args.safeAddress}`;
×
90
      const { data } = await this.networkService.get<CampaignRank>({ url });
×
91
      return data;
×
92
    } catch (error) {
93
      throw this.httpErrorFactory.from(error);
×
94
    }
95
  }
96

97
  async getLockingRank(safeAddress: `0x${string}`): Promise<LockingRank> {
98
    try {
×
99
      const url = `${this.baseUri}/api/v1/leaderboard/${safeAddress}`;
×
100
      const { data } = await this.networkService.get<LockingRank>({ url });
×
101
      return data;
×
102
    } catch (error) {
103
      throw this.httpErrorFactory.from(error);
×
104
    }
105
  }
106

107
  async getLeaderboard(args: {
108
    limit?: number;
109
    offset?: number;
110
  }): Promise<Page<LockingRank>> {
111
    try {
×
112
      const url = `${this.baseUri}/api/v1/leaderboard`;
×
113
      const { data } = await this.networkService.get<Page<LockingRank>>({
×
114
        url,
115
        networkRequest: {
116
          params: {
117
            limit: args.limit,
118
            offset: args.offset,
119
          },
120
        },
121
      });
122
      return data;
×
123
    } catch (error) {
124
      throw this.httpErrorFactory.from(error);
×
125
    }
126
  }
127

128
  async getCampaignLeaderboard(args: {
129
    resourceId: string;
130
    limit?: number;
131
    offset?: number;
132
  }): Promise<Page<CampaignRank>> {
133
    try {
×
134
      const url = `${this.baseUri}/api/v1/campaigns/${args.resourceId}/leaderboard`;
×
135
      const { data } = await this.networkService.get<Page<CampaignRank>>({
×
136
        url,
137
        networkRequest: {
138
          params: {
139
            limit: args.limit,
140
            offset: args.offset,
141
          },
142
        },
143
      });
144
      return data;
×
145
    } catch (error) {
146
      throw this.httpErrorFactory.from(error);
×
147
    }
148
  }
149

150
  async getLockingHistory(args: {
151
    safeAddress: `0x${string}`;
152
    limit?: number;
153
    offset?: number;
154
  }): Promise<Page<LockingEvent>> {
155
    try {
×
156
      const url = `${this.baseUri}/api/v1/all-events/${args.safeAddress}`;
×
157
      const { data } = await this.networkService.get<Page<LockingEvent>>({
×
158
        url,
159
        networkRequest: {
160
          params: {
161
            limit: args.limit,
162
            offset: args.offset,
163
          },
164
        },
165
      });
166
      return data;
×
167
    } catch (error) {
168
      throw this.httpErrorFactory.from(error);
×
169
    }
170
  }
171
}
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