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

vaariance / eip-712 / 15663061800

15 Jun 2025 12:13PM UTC coverage: 84.0%. First build
15663061800

push

github

code-z2
feat: implement EIP-712 structured data signing

- Add core EIP-712 signing functionality with v3/v4 support
- Introduce TypedDataEncoder class for message encoding
- Add domain separator and type validation support
- Implement comprehensive type handling including arrays and custom structs
- Add utilities for hex/bigint conversions and ABI encoding
- Include example usage and update documentation
- Set up CI/CD with coverage reporting

210 of 250 new or added lines in 5 files covered. (84.0%)

210 of 250 relevant lines covered (84.0%)

1.24 hits per line

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

57.41
/lib/src/typed_data.g.dart
1
// GENERATED CODE - DO NOT MODIFY BY HAND
2

3
part of 'typed_data.dart';
4

5
// **************************************************************************
6
// JsonSerializableGenerator
7
// **************************************************************************
8

9
_MessageTypeProperty _$MessageTypePropertyFromJson(Map<String, dynamic> json) =>
1✔
10
    _MessageTypeProperty(
1✔
11
      name: json['name'] as String,
1✔
12
      type: json['type'] as String,
1✔
13
    );
14

NEW
15
Map<String, dynamic> _$MessageTypePropertyToJson(
×
16
  _MessageTypeProperty instance,
NEW
17
) => <String, dynamic>{'name': instance.name, 'type': instance.type};
×
18

19
_TypedMessage _$TypedMessageFromJson(Map<String, dynamic> json) =>
1✔
20
    _TypedMessage(
1✔
21
      types: (json['types'] as Map<String, dynamic>).map(
2✔
22
        (k, e) => MapEntry(
2✔
23
          k,
24
          (e as List<dynamic>)
25
              .map(
1✔
26
                (e) => MessageTypeProperty.fromJson(
2✔
27
                  Map<String, String>.from(e as Map),
1✔
28
                ),
29
              )
30
              .toList(),
1✔
31
        ),
32
      ),
33
      primaryType: json['primaryType'] as String,
1✔
34
      domain:
35
          json['domain'] == null
1✔
36
              ? null
37
              : EIP712Domain.fromJson(json['domain'] as Map<String, dynamic>),
2✔
38
      message: json['message'] as Map<String, dynamic>,
1✔
39
    );
40

NEW
41
Map<String, dynamic> _$TypedMessageToJson(_TypedMessage instance) =>
×
NEW
42
    <String, dynamic>{
×
NEW
43
      'types': instance.types,
×
NEW
44
      'primaryType': instance.primaryType,
×
NEW
45
      'domain': instance.domain,
×
NEW
46
      'message': instance.message,
×
47
    };
48

49
_EIP712Domain _$EIP712DomainFromJson(Map<String, dynamic> json) =>
1✔
50
    _EIP712Domain(
1✔
51
      name: json['name'] as String?,
1✔
52
      version: json['version'] as String?,
1✔
53
      chainId: _$JsonConverterFromJson<Object, BigInt>(
1✔
54
        json['chainId'],
1✔
55
        const BigintConverter().fromJson,
1✔
56
      ),
57
      verifyingContract: _$JsonConverterFromJson<Object, EthereumAddress>(
1✔
58
        json['verifyingContract'],
1✔
59
        const EthereumAddressConverter().fromJson,
1✔
60
      ),
61
      salt: _$JsonConverterFromJson<Object, Uint8List>(
1✔
62
        json['salt'],
1✔
63
        const U8AConverter().fromJson,
1✔
64
      ),
65
    );
66

NEW
67
Map<String, dynamic> _$EIP712DomainToJson(_EIP712Domain instance) =>
×
NEW
68
    <String, dynamic>{
×
NEW
69
      'name': instance.name,
×
NEW
70
      'version': instance.version,
×
NEW
71
      'chainId': _$JsonConverterToJson<Object, BigInt>(
×
NEW
72
        instance.chainId,
×
NEW
73
        const BigintConverter().toJson,
×
74
      ),
NEW
75
      'verifyingContract': _$JsonConverterToJson<Object, EthereumAddress>(
×
NEW
76
        instance.verifyingContract,
×
NEW
77
        const EthereumAddressConverter().toJson,
×
78
      ),
NEW
79
      'salt': _$JsonConverterToJson<Object, Uint8List>(
×
NEW
80
        instance.salt,
×
NEW
81
        const U8AConverter().toJson,
×
82
      ),
83
    };
84

85
Value? _$JsonConverterFromJson<Json, Value>(
1✔
86
  Object? json,
87
  Value? Function(Json json) fromJson,
88
) => json == null ? null : fromJson(json as Json);
1✔
89

NEW
90
Json? _$JsonConverterToJson<Json, Value>(
×
91
  Value? value,
92
  Json? Function(Value value) toJson,
NEW
93
) => value == null ? null : toJson(value);
×
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