blockchain_utility_suite
v1.0.2
Published
A collection of basic Node.js blockchain utility functions.
Readme
Blockchain Utility Suite
Overview
A Effective and fully packed JavaScript-based blockchain utility module using ethers.js to interact with the Ethereum network.
Installation
Install via npm
npm install blockchain_utility_suiteClone from GitHub
git clone https://github.com/Soundar6385/blockchain-service.git
cd blockchain_utility_suite
npm installUsage
const BlockchainService = require('blockchain-service');
const service = new BlockchainService('https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID');Features
Create Wallet
const wallet = service.createWallet();
console.log(wallet.address, wallet.privateKey);Get Balance
service.getBalance('0xYourAddress').then(console.log);Send Transaction
service.sendTransaction('your-private-key', '0xRecipientAddress', '0.01')
.then(console.log);Sign Message
service.signMessage('your-private-key', 'Hello, Blockchain!')
.then(console.log);Get Transaction Details
service.getTransaction('0xTransactionHash').then(console.log);Get Current Block Number
service.getBlockNumber().then(console.log);Get Gas Price
service.getGasPrice().then(console.log);Estimate Gas
service.estimateGas({ to: '0xRecipientAddress', value: ethers.parseEther('0.01') })
.then(console.log);Resolve ENS Name
service.resolveENS('vitalik.eth').then(console.log);Verify Contract Address
service.verifyContract('0xContractAddress').then(console.log);Get ERC-20 Token Balance
service.getTokenBalance('0xWalletAddress', '0xTokenAddress').then(console.log);Get ERC-20 Token Symbol
service.getTokenSymbol('0xTokenAddress').then(console.log);Contributing
- Fork the repository on GitHub.
- Clone your forked repository:
git clone https://github.com/Soundar6385/blockchain-service.git - Create a new branch:
git checkout -b feature-branch - Make your changes and commit:
git commit -m "Your descriptive commit message" - Push to your fork:
git push origin feature-branch - Create a pull request on GitHub.
Publishing to npm
- Ensure you are logged into npm:
npm login - Update the package version if needed:
npm version patch - Publish the package:
npm publish --access public
Issues & Contributions
If you find any issues or would like to contribute, please open an issue or create a pull request on GitHub.
📄 License
This project is licensed under the MIT License.
