Web3 Integration
# Web3 Integration
Turkchain supports standard Web3 libraries.Ethers.js Example
// Some code
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider(
"https://rpc.turkchain1919.com"
);
const blockNumber = await provider.getBlockNumber();
console.log(blockNumber);Send Transaction
// Some code
const wallet = new ethers.Wallet(PRIVATE_KEY, provider);
const tx = await wallet.sendTransaction({
to: "0xRecipientAddress",
value: ethers.parseEther("1.0")
});
await tx.wait();Web3.js Example
Last updated