pub struct Eip712Parser;Expand description
Parser for EIP-712 JSON payloads.
Implementations§
Source§impl Eip712Parser
impl Eip712Parser
Sourcepub fn parse(json: &str) -> Result<TypedData, String>
pub fn parse(json: &str) -> Result<TypedData, String>
Parse a JSON string conforming to the EIP-712 eth_signTypedData_v4 format.
§Errors
Returns an error if the JSON is malformed or missing required fields.
Sourcepub fn primary_type_fields<'a>(
td: &'a TypedData,
) -> Option<&'a Vec<Eip712TypeField>>
pub fn primary_type_fields<'a>( td: &'a TypedData, ) -> Option<&'a Vec<Eip712TypeField>>
Returns the type fields for the primary type.
Sourcepub fn domain_separator_hex(td: &TypedData) -> String
pub fn domain_separator_hex(td: &TypedData) -> String
Compute the EIP-712 domain separator hash.
Returns the domain separator as a hex string.
Auto Trait Implementations§
impl Freeze for Eip712Parser
impl RefUnwindSafe for Eip712Parser
impl Send for Eip712Parser
impl Sync for Eip712Parser
impl Unpin for Eip712Parser
impl UnsafeUnpin for Eip712Parser
impl UnwindSafe for Eip712Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more