feat(ethers5): add Trezor connector for EVM chains - #5739
Conversation
Register a Trezor connector in the ethers5 adapter's syncConnectors,
mirroring how the Bitcoin adapter offers its own, so "Trezor" appears
in the eip155 Connect view without any host-app wiring.
The connector is an EIP-1193 provider backed by @trezor/connect-web:
accounts come from the device on the standard Ethereum path
(m/44'/60'/0'/0/0, single account), transactions are signed on the
device and broadcast as legacy gas-price transactions through the
active network's RPC endpoint (Rootstock has no EIP-1559), and
read-only JSON-RPC calls are forwarded to that same endpoint. Chain
switching validates against the adapter's configured networks.
|
|
@ronaldsg20 is attempting to deploy a commit to the Reown Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for your contribution! We ask that you please read and sign our CTA Document before we can accept your contribution. You can sign the CTA simply by posting a Pull Request Comment with the following text: I have read the CTA Document and I hereby sign the CTA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Description
Adds a Trezor connector for EVM chains to the ethers5 adapter, so "Trezor" is offered in the eip155 Connect view the same way the Bitcoin adapter already offers its own Trezor connector.
The connector is an EIP-1193 provider backed by
@trezor/connect-web:m/44'/60'/0'/0/0, single account), matching the address MetaMask and Ledger Live show for the same seed.ethereumSignTransaction) and broadcast as legacy gas-price transactions through the active network's RPC endpoint — compatible with every EVM chain, including ones without EIP-1559 support such as Rootstock. Missingnonce/gasPrice/gasfields are filled from the RPC before signing.personal_sign,eth_signandeth_signTypedData(_v4).wallet_switchEthereumChain) validates against the adapter's configured networks and emitschainChanged.Registration happens automatically in
Ethers5Adapter.syncConnectors()viaTrezorConnector.getWallet(), mirroring the Bitcoin adapter — no host-app wiring required.Since Trezor Connect is a page-global singleton shared between namespaces, both this connector and the Bitcoin one now treat
init()reporting "already initialized" as success, so whichever namespace connects first wins the init and the other reuses the instance.Type of change
Associated Issues
N/A
Showcase (Optional)
Validated manually end to end on a real Trezor device from a host dapp using the ethers5 adapter: connect (account listed in the modal and derived on the device), chain switching across configured networks, and a successful Rootstock pegout — both a native transfer transaction and a Flyover contract call with value — signed on the device and broadcast through the network RPC.
Checklist