feat(tipping): tip-code payload + TippingCoordinator module - #1117
Merged
Merged
Conversation
Port the tip code from the iOS app: PayloadKind becomes a sealed interface where each kind owns its own encode/decode, and Tip encodes the recipient's 16-byte userId (kind 0x02 at offset 1) instead of a username. OpenCodePayload delegates encoding to the kind. Adds the shared/tipping module with a TippingCoordinator that resolves a user's profile/userId and assembles the scannable Scannable.TipCard, which now carries the resolved UserProfile.
bmc08gt
added a commit
that referenced
this pull request
Jul 24, 2026
Port the tip code from the iOS app: PayloadKind becomes a sealed interface where each kind owns its own encode/decode, and Tip encodes the recipient's 16-byte userId (kind 0x02 at offset 1) instead of a username. OpenCodePayload delegates encoding to the kind. Adds the shared/tipping module with a TippingCoordinator that resolves a user's profile/userId and assembles the scannable Scannable.TipCard, which now carries the resolved UserProfile.
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
Updates the tip-card scan code to carry the userID and not the username, which is what it carried in code.
Payload (
services/opencode)PayloadKindbecomes a sealed interface where each kind owns its own encode/decode.Cash/MultiMintCashshare aPaymentbase;TipandUnknownare their own.Tipcodes now encode the recipient's 16-byte userId at offset 1 (kind0x02), — replacing the outdated username encoding. No nonce, no rendezvous.OpenCodePayload.encode()/fromList()delegate to the kind; existingwhen (kind)consumers are unchanged.Tipping module (
apps/flipcash/shared/tipping)TippingCoordinator: resolves a user'sUserProfile(the current user, or a scanned counterparty) and assembles the scannableScannable.TipCard— mirroring how the cash screen builds a bill to present.Scannable.TipCardnow carries the resolvedUserProfile(wasusername: String); it has no consumers yet oncode/cash.Testing
./gradlew :apps:flipcash:app:assembleDebug— BUILD SUCCESSFUL (built standalone offcode/cash):apps:flipcash:shared:tippingunit tests pass:services:opencodeandroidTestcompiles (userId round-trip + offset assertions)