0.7.0
What's Changed
Enhancements
- Add combined event filters: fetch multiple events (OR semantics) in a single
eth_getLogs
request withEthers.EventFilter.combine/1, or all events of a contract by passing its
EventFilters module (e.g.Ethers.get_logs(MyContract.EventFilters, address: "0x...")) —
the resultingEthers.CombinedEventFilterworks withEthers.get_logs/2and
Ethers.batch/2and decodes each fetched log with its matching event selector - Add EIP-191 personal message support: hash, recover
and verify messages withEthers.PersonalMessage, and sign them viaEthers.personal_sign/2
with theEthers.Signer.LocalandEthers.Signer.JsonRPCsigners through the new optional
personal_sign/2signer callback (named after the RPC method it mirrors) - Add universal signature verification with
Ethers.Signature: verify any signature —
EOA (ecrecover), smart-contract wallets (ERC-1271)
and counterfactual, not-yet-deployed wallets (ERC-6492)
against a digest, an EIP-191 personal message or EIP-712 typed data with
Ethers.Signature.verify_hash/4,verify_message/4andverify_typed_data/4 - Add Sign-In with Ethereum (EIP-4361) support with
Ethers.Siwe: build (new/1), render (to_message/1), parse (parse/1) and validate
(validate/2) SIWE messages, generate session nonces (generate_nonce/0), and verify a
message and its signature end-to-end withEthers.Siwe.verify/3— smart-contract wallets
included via the universal signature verification above - Add EIP-712 typed data support: construct typed
structured data withEthers.TypedData, hash it (encode_type,type_hash,hash_struct,
domain_separator,hash), sign it viaEthers.sign_typed_data/2with theEthers.Signer.Local
andEthers.Signer.JsonRPC(eth_signTypedData_v4) signers, and recover/verify the signer with
Ethers.TypedData.recover_signer/2andEthers.TypedData.valid_signature?/3 - Add a struct DSL for EIP-712 typed data: declare typed-data struct types as Elixir modules with
use Ethers.TypedData.Schemaand thetyped_schema/fieldmacros, then build an
Ethers.TypedDatadirectly from struct instances viaEthers.TypedData.new/2(andnew!/2)
Pull Requests in Release
- Add EIP-712 Typed Data Support by @alisinabh in #264
- Add EIP-191 personal message (personal_sign) support by @alisinabh in #265
- Add universal signature verification (ERC-1271 + ERC-6492) by @alisinabh in #266
- Add Sign-In with Ethereum (EIP-4361) support by @alisinabh in #267
- Recommend Ethers.Signature over the EOA-only verification helpers by @alisinabh in #268
- Add a way to fetch all contract events by @ddallaire in #222
Full Changelog: v0.6.13...v0.7.0