Method: Klay::Signature#recover_typed_data
- Defined in:
- lib/klay/signature.rb
#recover_typed_data(typed_data, signature, chain_id = Chain::CYPRESS) ⇒ String
Recovers a public key from a typed data structure and a signature on a given chain. (EIP-712) Ref: https://eips.ethereum.org/EIPS/eip-712
103 104 105 106 |
# File 'lib/klay/signature.rb', line 103 def recover_typed_data(typed_data, signature, chain_id = Chain::CYPRESS) hash_to_sign = Eip712.hash typed_data recover hash_to_sign, signature, chain_id end |