pulsechain.box
Getting Started

Web3.js

Connect to PulseChain using web3.js v4.

Connect to PulseChain using web3.js v4.

Setup

npm install web3

Basic usage

import Web3 from "web3";

const web3 = new Web3("https://rpc.pulsechain.box");

// Get latest block number
const blockNumber = await web3.eth.getBlockNumber();
console.log("Block:", blockNumber);

// Get native PLS balance
const balance = await web3.eth.getBalance("0x3693693693693693693693693693693693693693");
console.log("Balance:", web3.utils.fromWei(balance, "ether"), "PLS");

// Get chain ID
const chainId = await web3.eth.getChainId();
console.log("Chain ID:", chainId); // 369

Read a contract

const ERC20_ABI = [
  { name: "name", type: "function", inputs: [], outputs: [{ type: "string" }] },
  { name: "symbol", type: "function", inputs: [], outputs: [{ type: "string" }] },
  { name: "decimals", type: "function", inputs: [], outputs: [{ type: "uint8" }] },
  { name: "balanceOf", type: "function", inputs: [{ type: "address" }], outputs: [{ type: "uint256" }] }
];

// WPLS contract
const wpls = new web3.eth.Contract(ERC20_ABI, "0xA1077a294dDE1B09bB078844df40758a5D0f9a27");

const name = await wpls.methods.name().call();
const symbol = await wpls.methods.symbol().call();
const balance = await wpls.methods.balanceOf("0x3693693693693693693693693693693693693693").call();

console.log(`${name} (${symbol}): ${web3.utils.fromWei(balance, "ether")}`);

Send a transaction

const account = web3.eth.accounts.privateKeyToAccount("YOUR_PRIVATE_KEY");
web3.eth.accounts.wallet.add(account);

const tx = await web3.eth.sendTransaction({
  from: account.address,
  to: "0xRECIPIENT_ADDRESS",
  value: web3.utils.toWei("1", "ether"),
  gas: 21000
});

console.log("TX hash:", tx.transactionHash);
Copyright © 2026 AvecdrA. Made with love.