Skip to content

feat: support bulk send n to n#10652

Draft
weatherstar wants to merge 29 commits intoxfrom
feat/bulk-send-n-to-n
Draft

feat: support bulk send n to n#10652
weatherstar wants to merge 29 commits intoxfrom
feat/bulk-send-n-to-n

Conversation

@weatherstar
Copy link
Contributor

No description provided.

weatherstar and others added 22 commits March 2, 2026 17:38
Migrate all self-built Solana transactions from Legacy Transaction to
VersionedTransaction (v0) to prepare for bulk send and ALT optimization.
Uses TransactionMessage.compileToV0Message() pattern. Also fixes v0
serialization in OKX swap, fee attachment, max send amount, and fee
payer extraction paths.
Solana transactions have a 1232-byte size limit, so bulk sends with many
recipients must be split into multiple transactions. This adds native
batch transfer support for SOL using greedy chunking with trial
serialization against PACKET_DATA_SIZE.

- Add nativeBatchTransferEnabled vault setting flag, enable for SOL
- Extract _buildInstructionsForTransfer helper from SOL Vault
- Add buildBulkSendEncodedTxs with 3-phase splitting algorithm
- Add buildBulkSendUnsignedTxs service method
- Update BulkSendAmountsInput to branch between native batch and
  contract-based flows
- Add BulkSendBatchProgress event for real-time progress tracking
- Show progress bar in BulkSendReview during multi-tx batch sends
When bulk-sending SPL tokens to recipients without an existing Associated
Token Account, the sender must pay rent per ATA creation. This change
tracks ATA creation count during tx building, displays the total rent
cost in the Review page, and validates the sender has sufficient SOL to
cover both network fees and ATA rent before allowing confirmation.
…counts

Replace N sequential getAccountInfo RPC calls with a single batched
getMultipleAccounts call (chunked per 100 addresses) when building
bulk send transactions, reducing latency from O(N) to O(N/100).
- Add BTC and SBTC (dev-only) to bulk send supported networks
- Enable native batch transfer in BTC vault settings
- Implement buildBulkSendEncodedTxs in BTC vault reusing existing
  multi-output coin selection logic with chunking (max 200 outputs)
- Add AddressTypeSelector (Taproot/SegWit/Legacy) as labelAddon on
  sender address field for BTC networks
- Add selectedDeriveType state to bulk send address input context
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enforce chain-specific minimum transfer amounts (minTransferAmount /
nativeMinTransferAmount from vault settings) across all bulk send input
modes: specified, range, custom, and address-stage amount input.
…ified and range modes

Move minTransferAmount computation from BaseBulkSendAmountsInput to
outer BulkSendAmountsInput where the context is created. Add per-transfer
minimum amount check in handleSpecifiedAmountChange and pass
minTransferAmount/tokenSymbol to validateRangeInput in the debounced
range handler.
… mode switch

Remove isGreaterThan(0) guard in validateRangeInput so rangeMin=0 correctly
triggers minTransferAmount validation. Add minAmount check to TableLayout
handleModeChange for consistent validation when switching to Custom mode.
…empt minimum

Add refreshUnsignedTxBeforeBatchSign hook to VaultBase (no-op default) and
override in Sol Vault to fetch a fresh recentBlockhash before signing each
subsequent transaction in a batch sequence, preventing expiration failures.

Also fix the insufficient SOL balance check in useBulkSendFeeEstimation to
reserve the sender's rent-exempt minimum (~0.00089 SOL), preventing
"insufficient funds for rent" simulation errors on account(0).
…osure (#10541)

Move split transaction info into CostCard with inline label and Popover
for details. Relocate insufficient native balance alert near fee section.
Add 4 new i18n keys for split txn and insufficient balance messages.
Add the BulkSendProcess page component and register it in both
the modal router (mobile) and home router (desktop) to support
transaction processing after BulkSendReview confirmation.
Replace direct navigation to bulk send page with a mode selection dialog
that lets users choose between One-to-many, Many-to-one, and Many-to-many
modes. The selected mode is passed as a route parameter to the bulk send
addresses input page. All three entry points (WalletActions, MoreActionButton,
PrimeBenefitsList) now show this dialog.
@revan-zhang
Copy link
Contributor

revan-zhang commented Mar 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

…te params

Add a mode change button to BulkSendAddressesInput page:
- Mobile: SwitchHor icon button in the header right
- Desktop: "Mode: X  Change" link below the title
Both open the existing mode selection dialog to switch bulk send mode in-place.

Also fix bulkSendMode not being read from route params, causing the mode
selected in the entry dialog to always be ignored (defaulting to OneToMany).
…d ManyToMany

Extract shared multi-line address+amount validation into reusable
useMultiLineAddressValidation hook. Split SenderAddressesInput into
SingleLine (OneToMany) and MultiLine (ManyToOne/ManyToMany) variants.
Split ReceiverAddressesInput into SingleLine (ManyToOne), ManyToMany
(address-only with count matching), and OneToMany sub-components.

Update BulkSendAddressesInput to conditionally run balance polling and
account auto-fill only for OneToMany, parse sender amounts for other
modes, reset form on mode switch, and use fallback tokenDetails for
non-OneToMany submit.
Add missing fiatValue property to ITokenFiat type assertion in
BulkSendAddressesInput. Remove unused useIntl import and unused
destructured variables in BulkSendProcess.
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.

3 participants