ExWeb3 / elixir_ethers

A comprehensive Web3 library for interacting with smart contracts on Ethereum using Elixir.
https://hexdocs.pm/ethers
Apache License 2.0
85 stars 19 forks source link

Signing Transactions using metamask #139

Closed Webitect0x closed 3 months ago

Webitect0x commented 3 months ago

I'm having issues trying to figure out how to work with metamask and this ethers library. I'm using a phoenix hook with ethers.js to get the address and signer but I don't know how to link the two together to execute transactions using that signer/address.

alisinabh commented 3 months ago

Hi,

Although Ethers does not have any direct way to actually execute transactions on Meta mask, you can still do it via phoenix hooks (javascript).

Simply forward the 'data' and 'to' address in Ethers.TxData struct to your hook and then use those as arguments of your favourite js ethereum library (ethers js, web3js)