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

safe-global / safe-client-gateway / 14131637198

28 Mar 2025 02:50PM UTC coverage: 90.473% (-0.1%) from 90.577%
14131637198

push

github

web-flow
Add datasource for Safe Decoder Service (#2313)

The new [Safe Decoder Service](https://safe-decoder.safe.global/docs) improves upon the decoder of the Safe Transaction Service. As such, we intend to migrate to it.

This lays the foundation of usage, by creating a datasource (with manager) and base repository for validating the responses:

- Add `safeDataDecoder.baseUri` (test) configuration
- Add `DataDecoderApiManager` interface, implementation and module
- Add `DataDecoderApi` interface, implementation and module
- Add validation schemas for `DataDecoded` and `Contract, with inferred types and builders
- Add base `DataDecoderRepository` for accessing/validating datasource responses
- Add appropriate test coverage of service and schemas

3207 of 3846 branches covered (83.39%)

Branch coverage included in aggregate %.

46 of 68 new or added lines in 8 files covered. (67.65%)

10980 of 11835 relevant lines covered (92.78%)

535.66 hits per line

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

0.0
/src/domain/interfaces/data-decoder-api.interface.ts
1
import type { Contract } from '@/domain/data-decoder/v2/entities/contract.entity';
2
import type { DataDecoded } from '@/domain/data-decoder/v2/entities/data-decoded.entity';
3
import type { Page } from '@/domain/entities/page.entity';
4
import type { Raw } from '@/validation/entities/raw.entity';
5

NEW
6
export const IDataDecoderApi = Symbol('IDataDecoderApi');
×
7

8
export interface IDataDecoderApi {
9
  getDecodedData(args: {
10
    data: `0x${string}`;
11
    to: `0x${string}`;
12
  }): Promise<Raw<DataDecoded>>;
13

14
  getContracts(args: {
15
    address: `0x${string}`;
16
    limit?: number;
17
    offset?: number;
18
  }): Promise<Raw<Page<Contract>>>;
19
}
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

© 2025 Coveralls, Inc