Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: batch transfer #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chandrabosep
Copy link

Description: Implemented Batch Transfer Functionality

Added batchTransferCommand function to handle batch transfers.

  • Validates input batch file and wallet existence.
  • Verifies sufficient funds in the wallet before processing each transaction.
  • Handles multiple batch transactions sequentially, ensuring that each transfer meets the wallet balance requirements.
  • Provides user-friendly output messages with transaction status, including successful confirmations and failure cases.
  • Improves error handling for common issues like invalid batch data, insufficient funds, or missing wallet.

Example Usage:

bun run batch --testnet --file ./batch.json

Batch File Format (batch.json):

[
  {
    "to": "0xA9ab8933Ff0467D51d13ea2bFECD81504Fc6f15a",
    "value": 0.000000001
  },
  {
    "to": "0xC0d2F97e6Bec1C04dA1188abA6F006AA4d04EEDC",
    "value": 0.000000002
  }
]

This file contains an array of transactions with recipient addresses (to) and the amounts to transfer (value) in tRBTC.

Short Description:

Implemented a batch transfer command that allows users to send multiple transactions in one batch, ensuring sufficient funds and wallet validation before processing, with clear output and error handling for each transaction.

Example:

Batch File (batch.json):

image

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant