encode_data

Function encode_data 

Source
pub fn encode_data(
    primary_type: &str,
    data: &Value,
    types: &Types,
) -> Result<Vec<Token>, Eip712Error>
Expand description

Encodes an object by encoding and concatenating each of its members.

The encoding of a struct instance is enc(value₁) ‖ enc(value₂) ‖ … ‖ enc(valueₙ), i.e. the concatenation of the encoded member values in the order that they appear in the type. Each encoded member value is exactly 32-byte long.

  • primaryType: The root type.
  • data: The object to encode.
  • types: Type definitions for all types included in the message.

Returns an encoded representation of an object