I would like to interact with the Hedera Testnet using web3.js or ethers.js. How can I do this?
I have previously interacted with Hedera Testnet using hedera-sdk-js
,
for example using the following code:
import {
AccountBalanceQuery,
Client
} from "@hashgraph/sdk";
const client = new Client({
network: "testnet"
});
const accountId = '0.0.3996280';
const balance = await new AccountBalanceQuery()
.setAccountId(accountId)
.execute(client);
console.log(
`Balance of ${accountId} in Tinybars:`,
balance.hbars.toTinybars().toString(10)
);
How can I do the equivalent of the above in web3.js/ ethers.js?