And, of course, you need to have metamask installed on your browser. You'll gain invaluable insights into querying the mirror node and incorporating hts. I have used provider = new ethers.providers.web3provider.
You need to run this code on a web application running on localhost or on a server. Calling associatetoken on hederatokenservice system contract is deprecated and can no longer associate to address(msg.sender). Associates the provided hedera account with the provided hedera token (s).
It can only associate to address(this). In this example, you will associate a token to an account and transfer tokens to the associated account by interacting with the hts contract deployed to hedera. Fork this repo into your github account. The goal with this example is to.
We'll use the mirror node api and hedera token service (hts) throughout this tutorial. For that i am trying to connect the metamask with ethers.js by setting the provider as per the documentation. Submit a pull request with a new directory containing your code snippet, plus a readme file that explains it. You can use the metamask faucet to add more funds.