Skip to content

Engine tokens multi send#3188

Merged
feruzm merged 2 commits intodevelopmentfrom
multi
May 6, 2026
Merged

Engine tokens multi send#3188
feruzm merged 2 commits intodevelopmentfrom
multi

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented May 6, 2026

Summary by CodeRabbit

  • New Features
    • ENGINE token transfers now support multiple recipients (up to 50) in a single transaction with input validation and per-recipient ops for reliable bulk distributions.
  • Integration
    • Transfer mutation for multi-recipient ENGINE transfers is now available to consumers.
  • Tests
    • Added coverage for multi-recipient ENGINE transfers, including recipient limits and error cases.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: affac55a-6975-46fb-86f0-e210ca311cc3

📥 Commits

Reviewing files that changed from the base of the PR and between d685ee5 and 1b3196f.

📒 Files selected for processing (2)
  • src/screens/transfer/screen/transferScreen.tsx
  • src/utils/transactionOpsBuilder.test.ts

📝 Walkthrough

Walkthrough

This PR adds multi-recipient support for ENGINE-layer TRANSFERs: it parses and validates comma/space-separated destinations (non-empty, max 50), expands a single transfer into per-recipient ENGINE actions, exposes a new multiEngineTransfer mutation, updates container/screen routing and HiveSigner payload generation, and adds tests for splitting and validation.

Changes

Multi-Recipient ENGINE Transfers

Layer / File(s) Summary
Data Shape / Ops Building
src/utils/transactionOpsBuilder.ts
Parse to into multiple destinations for ENGINE/TRANSFER, validate non-empty and ≤50 recipients, and return flattened per-recipient engine transfer ops via getEngineActionOpArray.
Core Mutation
src/hooks/useTransferMutations.ts
Add multiEngineTransfer mutation that builds per-destination Engine actions (EngineActions.TRANSFER) and broadcasts them as a single op set; invalidates recipient wallets after broadcast.
Container Routing
src/containers/transferContainer.ts
Split destination into array, validate count, and route to transferEngine for single recipient or multiEngineTransfer for multiple recipients.
UI / Signer Integration
src/screens/transfer/screen/transferScreen.tsx
Enable multiple destinations for ENGINE/TRANSFER via allowMultipleDest; when using HiveSigner and multiple ENGINE recipients, construct a hiveuri-encoded ops payload with per-recipient custom_json engine actions and append authority.
Tests
src/utils/transactionOpsBuilder.test.ts
Add tests asserting engine_op routing for ENGINE/TRANSFER, splitting of multi-recipient inputs (comma/space), and validation errors for empty and >50 recipients.

Sequence Diagram

sequenceDiagram
    participant User
    participant Screen as Transfer Screen
    participant Container as Transfer Container
    participant Mutation as useTransferMutations
    participant OpsBuilder as OpsBuilder
    participant Broadcast as Broadcast

    User->>Screen: Submit ENGINE TRANSFER with multiple destinations
    Screen->>Container: Forward transfer request (destinations array)
    Container->>Container: Parse & validate recipients (1..50)
    alt multiple recipients
        Container->>Mutation: Call multiEngineTransfer
        Mutation->>OpsBuilder: Request per-recipient ENGINE actions
        OpsBuilder->>OpsBuilder: Build engine_op per recipient
        OpsBuilder-->>Mutation: Return ops array
        Mutation->>Broadcast: Broadcast combined ops payload
    else single recipient
        Container->>Mutation: Call transferEngine (single op)
        Mutation->>Broadcast: Broadcast single op
    end
    Broadcast-->>User: Return confirmation/result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I tunneled through code with a hop and a cheer,

Fifty friends now receive tokens near,
Each engine_op hums, each path is clear,
A bunny's small patchwork of transfers — sincere. 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Engine tokens multi send' accurately describes the main change—adding multi-recipient transfer support for ENGINE token transfers.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch multi

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm merged commit c9d3065 into development May 6, 2026
8 checks passed
@feruzm feruzm deleted the multi branch May 6, 2026 14:10
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