Add mobile bulk payout screen and Soroswap quote lib - #513
Conversation
Ports sdk bulk payout batching into a native screen for assembling recipients and signing once for the whole batch, and adds a Soroswap-backed quote lib for live swap pricing on the mobile app.
|
@0xDeon is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@0xDeon Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Miracle656
left a comment
There was a problem hiding this comment.
Thanks for the work here — the Soroswap side is solid, but I need one change before this can merge.
What's good
#473 is fully met. frontend/mobile/lib/soroswap.ts is a faithful port of the wallet helper, and app/swap.tsx drives a debounced live quote showing output, rate, and price impact. npx tsc --noEmit passes in frontend/mobile, no merge conflicts, no junk files, and the diff stays inside the scope of the two issues. Nothing to change there.
What blocks merge
#471's acceptance criterion isn't met, and the screen reports success anyway.
The acceptance is "add N recipients, sign once, all payments submitted." In frontend/mobile/app/bulk-payout.tsx, submitBatch never builds a transaction, never requests a signature, and never touches the network:
const submitBatch = async (batch: PayoutRow[]): Promise<BatchSubmitResult> => {
return {
txHash: `pending-${Date.now().toString(36)}`,
rowIndices: batch.map((_, i) => i),
};
};That resolves successfully every time, so executeBulkPayout returns an empty failedRows, and the screen advances to the done state showing "Payout submitted", the recipient count, and a synthetic pending-… string in the position where a transaction hash belongs. A user who adds ten recipients and taps "Sign once & submit batch" is told ten people were paid when nothing left the device. A fake hash on a payments screen is worse than an unimplemented button.
I understand the constraint — the mobile app was only scaffolded in #503 and has no keystore, passkey, or signer yet, so a real submission genuinely isn't wireable today. That's fine. The problem is presenting the placeholder as a completed payout.
What I need
Either of these works:
- Preferred — wire the real path. Build the batch transaction and submit it, so one signature covers all rows as the issue specifies.
- Acceptable — be honest about the placeholder. Keep the form, validation, totals, and one-signature batch shape, but don't claim success. Have
submitBatchreject (or gate the button) with a clear "batch signing not available yet" message, drop the syntheticpending-…hash from the success screen, and leave aTODOnaming the signing dependency.executeBulkPayoutalready routes a thrown error intofailedRows, so the existing error handling covers this.
If you take option 2, say so in the PR description and drop Closes #471 to Refs #471 — I'll keep that issue open and track the signing work separately, and you'll still be credited for #473.
Two non-blocking notes
EXPO_PUBLIC_SOROSWAP_API_KEYis inlined into the shipped bundle by Expo, so that key is extractable from any installed build. Worth proxying through a backend before this reaches production, though that's out of scope here.@soroswap/sdk@0.4.0declaresengines: { node: ">=22.0.0" }and pulls inaxios. It typechecks, but please confirm the quote call actually resolves on-device — the manual test box in your description is still unchecked.
Ping me once the submission path is updated and I'll re-review promptly.
Summary
frontend/mobile/app/bulk-payout.tsx: assemble N recipients, sign once, submit the whole batch as a single authorized transaction.frontend/mobile/lib/bulkPayout.ts: validation + single-batch submission helper (ported fromsdk/src/bulkPayout.ts).frontend/mobile/lib/soroswap.ts: Soroswap quote/build/token-resolve helpers (ported fromfrontend/wallet/lib/soroswap.ts, usingEXPO_PUBLIC_*env vars).frontend/mobile/app/swap.tsx: minimal screen showing a live quote/rate + price impact as the input amount changes.Closes #471
Closes #473
Test plan
npx tsc --noEmitpasses infrontend/mobile