@sifat046/blockchain-web3-tools
v0.2.0
Published
Lightweight multi-chain wallet connector + BP Coin test utils
Maintainers
Readme
🔗 Web3 Toolkit
🌐 About
Web3 Toolkit is a lightweight, developer-friendly npm library for blockchain integration. It includes:
- 🔗 Multi-chain wallet connectors (EVM & Solana)
- 🪙 BP Coin Test Utils—for signing, verifying & simulating transactions in test environments
No bulky SDKs. Great for dApps, rapid prototyping, and blockchain learning! ⚡
✨ Features
- 🦊 EVM Connector — Works with MetaMask and other EIP-1193 providers
- 🪂 Solana Connector — For Phantom and Solana wallets
- 🪙 BP Coin Test Utils — Sign, verify, simulate transactions with a minimal dev-friendly toolkit
- ⚡ Zero heavy dependencies — lightweight by design
📦 Installation
npm install @sifat046/blockchain-web3-tools🚀 Usage Examples
🔗 EVM (e.g., MetaMask)
import { Connectors } from "@sifat046/blockchain-web3-tools";
const evm = new Connectors.EvmConnector();
await evm.connect();
console.log("Accounts:", await evm.getAccounts());
const signature = await evm.signMessage("Hello Web3");🪂 Solana (e.g., Phantom)
import { Connectors } from "@sifat046/blockchain-web3-tools";
const sol = new Connectors.SolanaConnector();
await sol.connect();
const [publicKey] = await sol.getAccounts();
const signature = await sol.signMessage("Hello Solana");🪙 BP Coin Test Utils
import { BpCoin } from "@sifat046/blockchain-web3-tools";
const kp = BpCoin.generateEd25519KeyPair();
const ledger = new BpCoin.InMemoryLedger();
const aliceAddr = BpCoin.exportPublicKeyPEM(kp.publicKey);
ledger.faucet(aliceAddr, 50);
const body = BpCoin.makeBody({
from: kp,
toAddress: "bob",
amount: 10,
nonce: 0,
});
const tx = BpCoin.signTx(body, kp);
console.log("Valid TX?", BpCoin.verifyTx(tx));
ledger.apply(tx);
console.log("Bob's balance:", ledger.balanceOf("bob"));🛠 Roadmap
- [ ] 🔗 WalletConnect support for EVM
- [ ] 🔄 Auto network switching
- [ ] ⚡ Example dApp boilerplate
🤝 Contributing
Contributions are welcome! Feel free to open issues, suggest improvements, or submit pull requests.
👤 Author
Md Sifat bin Jibon 📍 Student & Full-Stack Dev | Dhaka, Bangladesh
📜 License
MIT © Md Sifat bin Jibon
