Web3 Coin
  • Welcome to Web3 Coin
  • Overview
    • 💡Our Vision
    • ✨Team
  • WhitePaper
    • Terminology
    • Abstract
    • Introduction
    • Vision
    • Overview
      • Current Problems of Existing Blockchain Networks
      • Web3Coin Solution
    • Web3Chain
      • An Overview for Web3Chain
      • Web3Anthill
      • EVM to MVM
      • Web3Chain Consensus Mechanism: PoW
      • Transaction Check Per Second (TCPS)
    • Proof of Web3 Consensus Mechanism
      • Web3Miner (WPoS & Web3Anthill)
        • Fees and Rewards
      • MacroMiner (MPoH & Web3Anthill)
        • Archive Node
        • Full Node
        • Light Node
      • MicroMiner (MPoSW & Web3Anthill)
    • Scalability
      • Blockchain Network Structure
      • Energy Consumption
    • Smart Contract
      • Smart Contract Compatibility
      • Smart Contract Fees
    • Transaction
      • Transaction Fees
    • Attack Vectors & Security
      • Transaction Denial
      • Eclipse Attack
      • Double Spending
    • Native Token
      • Web3 Coin (W3B)
      • Token Burning
        • Transaction Fee Burning
        • Constant Burning
      • Pool Distribution
    • Experimental Results
    • Information
    • Audit
    • Solution and Conclusion
      • Focused on 'Human'
    • References
    • Disclaimer
  • Fundamentals
    • 🌎Tokenomics
      • Chart
    • 🗺️ROADMAP
  • FAQ
    • ❓What is Web3Coin?
    • ⭐Good to Know
    • 💾Web3Anthill
  • Products
    • Web3Chain
    • Web3 Airdrop
    • Web3 Coin (W3B)
    • Web3Dex
    • Web3Exchange
    • Web3Explorer
    • Web3Launchpad
    • Web3NFT
Powered by GitBook
On this page
  1. WhitePaper

Transaction

PreviousSmart Contract FeesNextTransaction Fees

Last updated 1 year ago

// require("dotenv").config();
const {ethers, Wallet} = require("ethers");

const network = {
    name:"Web3 Testnet",
    endpoint:"https://test.web3finance.me/rpc",
};

const provider = new ethers.providers.JsonRpcProvider(network.endpoint);
const wallet = new Wallet(process.env.PRIVATE_KEY);

const getTxnInstance = async () => {
    const nonce = await wallet.getTransactionCount();
    const gasPrice = await provider.getGasPrice();
    const gasLimit = 21_000;
    const chainID = await provider.getChainID();
    
    const tx = {
        from: wallet.address,
        to: ethers.constants.AddressZero,
        value: ethers.utils.parseEther(1),
        gasLimit,
        gasPrice,
        nonce,
        chainId,
        data: "0x",
        type: null,
    };
    
    return tx;
};

(async() => {
    const txInstance = await.getTxnInstance();
    await wallet.sendTransaction(txnInstance);
})();

In the Web3Chain network, developers can develop on the network using libraries such as Web 3.0 and Ethers.