Skip to content

πŸš€ Batch Operations Plugin β€” CSV-Driven Bulk Operations for Hedera#1470

Open
chinesepowered wants to merge 2 commits intohiero-ledger:mainfrom
chinesepowered:claude/hiero-cli-plugin-5HXiG
Open

πŸš€ Batch Operations Plugin β€” CSV-Driven Bulk Operations for Hedera#1470
chinesepowered wants to merge 2 commits intohiero-ledger:mainfrom
chinesepowered:claude/hiero-cli-plugin-5HXiG

Conversation

@chinesepowered
Copy link

@chinesepowered chinesepowered commented Feb 20, 2026

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

Command Description
batch transfer-hbar Batch HBAR transfers from a CSV file
batch transfer-ft Batch fungible token transfers from a CSV file
batch mint-nft Batch mint NFTs from a CSV file
batch airdrop Batch airdrop tokens via HIP-904 (auto-handles association)

Why 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

  • 4 production commands following ADR-003 contract with Zod input/output schemas and Handlebars templates
  • CSV parser with quoted field support, header validation, and clear error messages
  • Sequential batch executor with per-row error handling (one failure doesn't stop the batch)
  • Dry-run mode (--dry-run) to validate all rows before spending any HBAR
  • Account alias support β€” use stored names (alice, bob) alongside raw account IDs
  • Flexible amount formats β€” display units (10 HBAR) or base units (100t tinybars)
  • Per-row results with HashScan transaction links
  • JSON output (--format json) for CI/CD pipelines
  • Native airdrop using Hedera's TokenAirdropTransaction (HIP-904)
  • 35 unit tests with full coverage of happy paths, edge cases, and partial failures
  • End-to-end demo script runnable against testnet
  • Example CSV files for each command

Architecture

Follows existing plugin patterns:

  • Manifest-driven registration via PluginManifest
  • CommandExecutionResult return contract (ADR-003)
  • Zod schemas for input validation + output typing
  • Handlebars templates for human-readable output
  • Reuses core services: api.txExecution, api.mirror, api.alias, api.hbar, api.token
  • Shared utilities (csv-parser, batch-executor) keep command handlers clean

Testing

  • 35 new unit tests β€” all passing
  • 865 total suite tests β€” zero regressions
  • Zero lint errors (ESLint + Prettier)
  • Clean TypeScript compilation and build

Test Plan

  • npm run test β€” all 865 tests pass
  • npm run lint β€” zero errors
  • npm run build β€” clean compilation
  • Manual testing with batch-operations-demo.sh against testnet

…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
@chinesepowered chinesepowered requested a review from a team as a code owner February 20, 2026 23:24
@devmab devmab moved this to In Progress in Hiero CLI Feb 26, 2026
@devmab devmab added this to Hiero CLI Feb 26, 2026
@devmab devmab moved this from In Progress to Backlog in Hiero CLI Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants