refactor(payments): DM-transfer delegates module + rename old payments→funding#1130
Merged
Conversation
…ents→funding Introduce shared:payments holding ContactPaymentDelegate and TipPaymentDelegate — the phone-number- and user-id-keyed cores for sending cash inside a DM (resolve recipient → attach chat-type metadata → directTransfer → debit local balance → sync feed). TippingCoordinator.confirmTip now delegates its transfer to TipPaymentDelegate; the out-of-chat tip flow is unchanged. Rename the existing shared:payments (add-money / purchase methods) to shared:funding so the "payments" name is free for the transfer module. Updates all consumers, Gradle paths, Android namespaces, Kotlin packages, and generated-R imports. Add an in-memory cache to ResolverController (an identity's on-chain address is effectively immutable), so a pre-send resolve and the delegate's send-time resolve collapse to a single network round-trip. Foundation for tip-chat sends in the messenger, which rebases on top of this. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0197MAdYdxVWvdqRU6TEqBwh
bmc08gt
added a commit
that referenced
this pull request
Jul 24, 2026
…ents→funding (#1130) Introduce shared:payments holding ContactPaymentDelegate and TipPaymentDelegate — the phone-number- and user-id-keyed cores for sending cash inside a DM (resolve recipient → attach chat-type metadata → directTransfer → debit local balance → sync feed). TippingCoordinator.confirmTip now delegates its transfer to TipPaymentDelegate; the out-of-chat tip flow is unchanged. Rename the existing shared:payments (add-money / purchase methods) to shared:funding so the "payments" name is free for the transfer module. Updates all consumers, Gradle paths, Android namespaces, Kotlin packages, and generated-R imports. Add an in-memory cache to ResolverController (an identity's on-chain address is effectively immutable), so a pre-send resolve and the delegate's send-time resolve collapse to a single network round-trip. Foundation for tip-chat sends in the messenger, which rebases on top of this. Claude-Session: https://claude.ai/code/session_0197MAdYdxVWvdqRU6TEqBwh
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.
What
Foundation for in-chat tip/contact payments, split out so the messenger chat-VM work can rebase on it.
1. New
shared:paymentsmodule — DM transfer delegatesTwo symmetric, self-contained delegates for sending cash inside a DM (resolve recipient → attach chat-type metadata →
directTransfer→ debit local balance → sync feed):ContactPaymentDelegate— keyed by phone number, contact-DM metadata.TipPaymentDelegate— keyed by user id, tip-DM metadata.TippingCoordinator.confirmTip()now delegates its transfer toTipPaymentDelegate; the out-of-chat tip flow is behaviorally unchanged (it keeps the tip-card / amount /LaunchChatorchestration).2. Rename old
shared:payments→shared:fundingThe existing module is about adding money (purchase methods / deposit / on-ramp), not sending payments — so it's renamed to free the
paymentsname for the transfer module. Updates all ~10 consumers, Gradle paths, Android namespaces, Kotlin packages (com.flipcash.app.payments→com.flipcash.app.funding), and generated-Rimports.3.
ResolverControllerin-memory cacheAn identity's on-chain address is effectively immutable, so successful resolutions are memoized (and the controller is now
@Singleton). This collapses a pre-send resolve + the delegate's send-time resolve into a single network round-trip.Verification
:apps:flipcash:app:compileDebugKotlin— full graph + Hilt aggregation, no dependency cycle:apps:flipcash:shared:payments:compileDebugKotlin:apps:flipcash:shared:funding:testDebugUnitTest,:apps:flipcash:shared:tipping:testDebugUnitTest— pass