chainsify
v1.0.1
Published
package that interacts with Ethereum blockchain
Readme
My Eth Package My Eth Package is a Node.js package that provides utilities for interacting with the Ethereum blockchain.
Features Get the latest block number on the Ethereum blockchain. Check the balance of an Ethereum address. Send Ether from one address to another. Installation To install My Eth Package, simply run:
perl Copy code npm install my-eth-package Usage javascript Copy code const myEthPackage = require('my-eth-package');
// Get the latest block number myEthPackage.getBlockNumber() .then(blockNumber => { console.log('Latest Block Number:', blockNumber); });
// Get the balance of an Ethereum address const address = '0x123...'; myEthPackage.getBalance(address) .then(balance => { console.log('Balance of', address, ':', balance, 'ETH'); });
// Send Ether from one address to another const senderPrivateKey = 'your_sender_private_key'; const receiverAddress = '0x456...'; const amount = '0.1'; // Ether myEthPackage.sendEther(senderPrivateKey, receiverAddress, amount) .then(transactionHash => { console.log('Transaction Hash:', transactionHash); }); Documentation getBlockNumber(): Returns a Promise that resolves to the latest block number on the Ethereum blockchain. getBalance(address): Returns a Promise that resolves to the balance of the specified Ethereum address in Ether. sendEther(senderPrivateKey, receiverAddress, amount): Sends Ether from one address to another. Requires the sender's private key, receiver's address, and the amount of Ether to send. Contributing Contributions are welcome! If you find a bug or want to add new features, please open an issue or submit a pull request.
