• 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

93.75
/lib/src/extensions.dart
1
part of 'typed_data.dart';
2

3
extension MessageTypesIndexing on MessageTypes {
4
  Object operator [](String key) => when(
2✔
5
    eip712Domain: (domain) {
1✔
6
      return domain[key] ??
1✔
7
          (throw ArgumentError(
1✔
8
            'Failed to get value for field `$key`: value was null',
1✔
9
          ));
10
    },
11
    additionalData: (dataMap) {
1✔
12
      if (!dataMap.containsKey(key)) {
1✔
13
        throw ArgumentError(
1✔
14
          'Failed to get value for field `$key`: key not found',
1✔
15
        );
16
      }
17
      return dataMap[key]!;
1✔
18
    },
19
  );
20

21
  T when<T>({
1✔
22
    required T Function(EIP712Domain domain) eip712Domain,
23
    required T Function(Map<String, dynamic> dataMap) additionalData,
24
  }) {
25
    if (this is Eip712Domain) {
1✔
26
      return eip712Domain(value as EIP712Domain);
2✔
27
    }
28
    if (this is AdditionalData) {
1✔
29
      return additionalData(value as Map<String, dynamic>);
2✔
30
    }
NEW
31
    throw StateError('Unhandled Union case: $this');
×
32
  }
33
}
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