Skip to content

Plugin for batch transactions#1475

Open
DivyanshGoel20 wants to merge 1 commit intohiero-ledger:mainfrom
DivyanshGoel20:batch-branch
Open

Plugin for batch transactions#1475
DivyanshGoel20 wants to merge 1 commit intohiero-ledger:mainfrom
DivyanshGoel20:batch-branch

Conversation

@DivyanshGoel20
Copy link

Split Payments Plugin

Summary

Adds a Split Payments plugin so you can run batch HBAR transfers from a single CSV file. Instead of running one transfer per command, you point the CLI at a CSV (to, amount) and it executes each row as a separate transfer, using a single payer (operator or --from).

Commands

Command Description
split-payments transfer Batch HBAR transfers from a CSV file (one transfer per row)

Why This Plugin?

Paying many recipients (refunds, rewards, payroll) usually means repeating the same transfer command or writing a script. This plugin turns a CSV plus one command into a full batch: validate with --dry-run, then run for real with the same file.

What's Included

  • 1 command following the existing plugin contract: Zod input/output schemas and a Handlebars template for human-readable output.
  • CSV input — Columns: to (account ID, EVM address, or CLI alias), amount (e.g. 10 for 10 HBAR or 100t for 100 tinybars). Optional header (to,amount); comma or semicolon; quoted fields supported.
  • Dry-run--dry-run validates the CSV and lists planned transfers without sending any transaction.
  • Payer — Uses operator or --from (alias or accountId:privateKey); optional --key-manager for key storage.
  • Per-row execution — Transfers run one after another; one failure does not stop the rest; output includes success/failure and HashScan links per row.
  • Flexible amounts — Display units (e.g. 10) or tinybars with t suffix (e.g. 100t).
  • JSON output--format json for scripting and CI.

Architecture

  • Manifest-driven registration via PluginManifest.
  • Handler returns CommandExecutionResult (ADR-003).
  • Reuses core: api.hbar.transferTinybar, api.txExecution, api.keyResolver, api.network, api.alias; shared processBalanceInput and formatError. CSV parsing and header detection live in the handler.

Prerequisites

  • Operator or --from — Payer must have enough HBAR for all transfers and fees.
  • CSV file — Path via --file (absolute or relative to cwd). Recipients must be valid account IDs, EVM addresses, or CLI aliases.

References

  • Hedera HBAR transfer (one transfer per CSV row).
  • CLI account/alias and network configuration for payer and network.

@DivyanshGoel20 DivyanshGoel20 requested a review from a team as a code owner February 21, 2026 14:31
@devmab devmab added this to Hiero CLI Feb 26, 2026
@devmab devmab moved this to In Progress in 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.

1 participant