You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #4 from ajrgrubbs/prep-1.0.0-api
Prep 1.0.0 api - big refactor to make this correct and usable
- Significant test improvements, including parity tests w/ Docker+Ganache
- Code coverage integration w/ TravisCI+Coveralls
- Several bugfixes
-`.to_message(domain: EIP712Struct)` - Convert the struct (and given domain struct) into the standard EIP-712 message structure.
6
+
-`.signable_bytes(domain: EIP712Struct)` - Get the standard EIP-712 bytes hash, suitable for signing.
7
+
-`.from_message(message_dict: dict)`**(Class method)** - Given a standard EIP-712 message dictionary (such as produced from `.to_message`), returns a NamedTuple containing the `message` and `domain` EIP712Structs.
8
+
9
+
#### Other stuff
10
+
-`.encode_value()` - Returns a `bytes` object containing the ordered concatenation of each members bytes32 representation.
11
+
-`.encode_type()`**(Class method)** - Gets the "signature" of the struct class. Includes nested structs too!
12
+
-`.type_hash()`**(Class method)** - The keccak256 hash of the result of `.encode_type()`.
13
+
-`.hash_struct()` - Gets the keccak256 hash of the concatenation of `.type_hash()` and `.encode_value()`
14
+
-`.get_data_value(member_name: str)` - Get the value of the given struct member
15
+
-`.set_data_value(member_name: str, value: Any)` - Set the value of the given struct member
16
+
-`.data_dict()` - Returns a dictionary with all data in this struct. Includes nested struct data, if exists.
17
+
-`.get_members()`**(Class method)** - Returns a dictionary mapping each data member's name to it's type.
0 commit comments