feat(transfers): real on-chain P2P OLTIN transfers + indexer-backed history - #47
Merged
Conversation
…istory Stage 2. Replace the phantom /transfers ledger with a real OLTIN transfer signed by the user's own non-custodial wallet, and swap transaction history onto the on-chain indexer (GET /transactions). Backend: - GET /users/lookup?oltin_id= — resolve a recipient to their wallet address (auth-gated, reuses get_user_by_oltin_id normalization; 404 if unknown, wallet_address null when the recipient never onboarded) Frontend: - send: resolve recipient address, sign OLTIN.transfer via viem, WAIT for receipt.status === 'success' (a broadcast hash alone can revert); amount parsed to wei with parseTokenAmount (never parseFloat — 18-decimal money path), balance checked in wei; self-transfer blocked; truncated address shown on confirm; the fake 1% fee is gone (V3 takes none — full amount moves, sender pays ETH gas); the phantom internal-accounts tab is removed - wallet: recent transactions read GET /transactions (real, indexer-backed); a missing wallet / 400 falls through to the empty state, not an error - contracts: point OLTIN at V3 (the retired V2 address was dead) - add lib/format.parseTokenAmount + vitest; useTransactions hook; Transaction + UserLookupResult types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 2 (scope-C). Real wallet-signed OLTIN P2P transfer (viem, receipt-gated) replacing the phantom ledger; history from GET /transactions (indexer). Backend: GET /users/lookup. Gate-2 APPROVED (все 3 ревью + on-chain премисса подтверждены). Gates green: api 163 passed/2 skip + ruff + mypy(users/); webapp tsc + eslint 0 err + vitest 13/13 (red→green). On-chain proven: viem→zkSync transferOltin receipt.status=success (tx 0xbda66515); indexer enabled + picks up events. Report: .claude/reports/2026-07-28-stage2-transfers.md. Follow-ups (non-blocking): receipt-timeout error text; auth on /users/search.