{"id":18878,"library":"tx-bundler","title":"tx-bundler","description":"An MVP-level library for batching multiple Ethereum transactions into one, reducing gas costs for exchanges and high-volume senders. Current version 0.1.2 is in active development and only supports the Sepolia testnet. It bundles transfers of native ETH (called coins) to multiple recipients in a single on-chain transaction. Key differentiator is simplicity: just provide an RPC URL, recipient list, amounts, and a private key. Not yet production-ready and not economical for single transfers. No published cadence; no TypeScript support.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","blockchain","ethereum","transaction","batch","batch transaction"],"install":[{"cmd":"npm install tx-bundler","lang":"bash","label":"npm"},{"cmd":"yarn add tx-bundler","lang":"bash","label":"yarn"},{"cmd":"pnpm add tx-bundler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying Ethereum interaction library for RPC, wallet, and transaction building.","package":"ethers","optional":false}],"imports":[{"note":"CommonJS default export is an object, not a function. Named import from object is required.","wrong":"const sendBatchedCoins = require('tx-bundler');","symbol":"sendBatchedCoins","correct":"const { sendBatchedCoins } = require('tx-bundler');"},{"note":"Package does not export ESM; only CommonJS is supported. Default import will fail.","wrong":"import pkg from 'tx-bundler';","symbol":"default","correct":"const pkg = require('tx-bundler');"},{"note":"No .default property; directly destructure from require result.","wrong":"const { sendBatchedCoins } = require('tx-bundler').default;","symbol":"sendBatchedCoins","correct":"const pkg = require('tx-bundler'); const { sendBatchedCoins } = pkg;"}],"quickstart":{"code":"const { sendBatchedCoins } = require('tx-bundler');\nconst RPC_URL = process.env.RPC_URL ?? 'https://sepolia.infura.io/v3/YOUR-PROJECT-ID';\nconst recipients = ['0xRecipient1...', '0xRecipient2...'];\nconst amounts = [0.001, 0.002];\nconst privateKey = process.env.PRIVATE_KEY ?? '';\nasync function main() {\n  const txHash = await sendBatchedCoins(RPC_URL, recipients, amounts, privateKey);\n  console.log('Batch transaction hash:', txHash);\n}\nmain().catch(console.error);","lang":"javascript","description":"Demonstrates sending a batched ETH transfer to two recipients on Sepolia testnet using an Infura RPC URL and a private key. Requires ethers as a peer dependency."},"warnings":[{"fix":"Wait for future versions that support mainnet or use an alternative batch transaction solution.","message":"The package only works on Sepolia testnet. Mainnet and other chains are not supported.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use only when sending multiple transfers in one go. For single transfers, use direct ETH transfer.","message":"Batching only saves gas when sending many transactions (e.g., dozens). For a single transaction, it costs more due to overhead.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require() in Node.js. For ESM projects, use dynamic import() or wait for an ESM update.","message":"The package does not export ESM; only CommonJS require() works. Using import may cause errors.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const { sendBatchedCoins } = require('tx-bundler');","cause":"Incorrect import: using default import from CommonJS module.","error":"TypeError: pkg.sendBatchedCoins is not a function"},{"fix":"Ensure the sending account has sufficient ETH on Sepolia (or use a faucet).","cause":"The account does not have enough ETH to cover the batched transfers and gas.","error":"Error: insufficient funds for gas * price + value"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}