π Batch Operations Plugin β CSV-Driven Bulk Operations for Hedera#1470
Open
chinesepowered wants to merge 2 commits intohiero-ledger:mainfrom
Open
π Batch Operations Plugin β CSV-Driven Bulk Operations for Hedera#1470chinesepowered wants to merge 2 commits intohiero-ledger:mainfrom
chinesepowered wants to merge 2 commits intohiero-ledger:mainfrom
Conversation
β¦ints Add a new 'batch' plugin that enables bulk Hedera operations from CSV files, reducing hundreds of manual CLI invocations to a single command. Commands: - batch transfer-hbar: Batch HBAR transfers from CSV (to, amount, memo) - batch transfer-ft: Batch fungible token transfers from CSV (to, amount) - batch mint-nft: Batch NFT mints from CSV (metadata per row) Features: - CSV parsing with quoted fields, header validation, and clear error messages - --dry-run flag to validate all rows before executing any transactions - Per-row results report with HashScan transaction links - Account alias resolution (stored names alongside raw account IDs) - Amount format support (display units and base units with 't' suffix) - Supply capacity validation for NFT mints - Partial failure handling with retry guidance - JSON output support for CI/CD pipelines (--format json) Includes 28 unit tests (CSV parser, transfer-hbar handler, mint-nft handler), example CSV files, and comprehensive README with usage documentation. https://claude.ai/code/session_01BG57n9YWLcXUKEoAt5VZ1V
Add batch airdrop command using Hedera's native TokenAirdropTransaction (HIP-904) which auto-handles token association β recipients do NOT need to pre-associate. Only the sender signs. Handles three scenarios: - Already associated β immediate transfer - Has auto-association slots β auto-associate + transfer - No slots β pending airdrop (recipient claims later) Also add end-to-end demo script (examples/scripts/batch-operations-demo.sh) that creates accounts, batch transfers HBAR, creates a token, and batch airdrops tokens β all from CSV files against testnet. Additional fixes: - Wrap resolveTokenParameter in try-catch across all handlers (it throws for unresolvable aliases instead of returning null) - 7 new unit tests for airdrop (35 total batch plugin tests, 865 total) https://claude.ai/code/session_01BG57n9YWLcXUKEoAt5VZ1V
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new Batch Operations Plugin that enables CSV-driven bulk operations on the Hedera network. Instead of running transfers or mints one at a time, users can execute hundreds of operations from a single command.
Commands
batch transfer-hbarbatch transfer-ftbatch mint-nftbatch airdropWhy This Plugin?
Developers working with Hedera frequently need to distribute tokens, pay multiple recipients, or mint batches of NFTs. Today this requires writing custom scripts or running commands one by one. This plugin turns that into a single CSV + one command.
What's Included
--dry-run) to validate all rows before spending any HBARalice,bob) alongside raw account IDs10HBAR) or base units (100ttinybars)--format json) for CI/CD pipelinesTokenAirdropTransaction(HIP-904)Architecture
Follows existing plugin patterns:
PluginManifestCommandExecutionResultreturn contract (ADR-003)api.txExecution,api.mirror,api.alias,api.hbar,api.tokencsv-parser,batch-executor) keep command handlers cleanTesting
Test Plan
npm run testβ all 865 tests passnpm run lintβ zero errorsnpm run buildβ clean compilationbatch-operations-demo.shagainst testnet