Repository navigation
Conversation
Contributor
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
8 tasks
26 tasks
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…fixes Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ow from quickpay Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jvsena42
force-pushed
the
feat/wear-nfc
branch
from
December 4, 2026 12:10
16602ed to
a80c8e4
Compare
This branch has not been deployed
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.
Part of #2105
Source: team, #2105
Warning
Do not publish the Wear app until #2152 ships. The watch runs the same Spark wallet as the phone, and Spark real-time sync is off (
realTimeSyncServerUrl = null), so two live instances share no state. Mainnet is also gated off in this build (Env.IS_MAINNET_ENABLED = false).Stacked on #2188 (
feat/wear-settings-sync). This PR adds NFC to the watch: receive by letting a phone tap the watch's receive QR screen, and pay by tapping a payment tag or a phone's Receive, also while Bitkit is in the background. BLE "nearby" is dropped from #2105's plan for simplicity.Description
D2760000850101, one URI recordlightning:<invoice>), using copies of the phone'sNdefTagService,Type4TagEmulator,NdefCodecandNfcTagEmitter. The tag is offered only while the QR screen is in front and visible (not ambient, resting or paid), the wallet is ready and the invoice is current by the wall clock; every exit takes it down, a payment revokes it at once, and a stale AID left by a killed process is removed at start.NfcHint), a dimmed and slashed hint with "Open NFC settings" when NFC is off, and none in ambient, while resting or without NFC.NDEF_DISCOVEREDfilter (the watch's payment schemes), so a tap with the screen on reaches Bitkit even when it isn't in front, and opens the existing flow: self-send guard, offline error, Review and hold, and QuickPay with the tap counted as attended. One tap fires once (NfcRepeatGuard,NfcTapFilter), a tap during a send is dropped, and a tag the watch can't pay shows "Not supported".MainActivitysingleTask, as on the phone, with a process-wideLaunchGateandSendMonitor, so links, taps and the tile always reach the one running app. This also fixes fix: keep wear payment links in one bitkit task #2187.android.hardware.nfc.hceas not required (as on the phone), adds the NFC permission and the HCE service.docs/wear.md› NFC), a journey, and manual tests injourneys/wear/README.md› NFC.Out of Scope
wear: whether Wear OS watches poll for tags and dispatchNDEF_DISCOVEREDat all is unknown; many ship NFC for card emulation only. If a watch doesn't, pay by tap would need reader mode on an app screen (foreground only). Manual test 1 answers it on a real watch.wear: BLE nearby payments are dropped for simplicity.wear/app: LUD-17lnurlp://links — fix: pay lud-17 lnurlp links on the phone and the watch #2190.Design
N/A — no design available. #2105 is a prototype with no Figma; the hint reuses the Balance page's NFC hint.
Preview
Large round emulator (454 px, Wear OS 7), local
./sparkstack, app commit7ac718aad. The emulator has no NFC radio, so the hint on the receive QR does not show; the tap is delivered as anNDEF_DISCOVEREDintent.Recording: a tap intent with Bitkit in the background opens Review; a repeat is dropped; holding pays.
nfc-pay-background.mp4
QA Notes
Setup
Wear_Large_Round_API37with the local-stack build (journeys/wear/README.md› Local./sparkstack). The emulator has no NFC radio:adbcan deliver anNDEF_DISCOVEREDintent with the link as data, but not the tag or its NDEF message, so real taps are manual tests.journeys/wear/README.md› On a physical watch.Journeys
nfc-pay-background.xml— a tap intent delivered while Bitkit is in the background opens Review; a repeat within 3 s is dropped; holding paysnfc-required.xml— NFC is required, HCE is declared not requiredManual Tests
Details and sub-cases are in
journeys/wear/README.md› NFC › Manual tests.Automated Checks
NdefCodecTest.kt,NfcPaymentUriTest.kt,Type4TagEmulatorTest.kt,NfcTagEmitterTest.kt— copies of the phone's tests for the tag format, APDUs and NDEF parsingNfcTagOfferTest.kt,NfcTagEffectTest.kt,ReceiveTagTest.kt— the tag is offered only while it should be and stops on every exitNfcTapFilterTest.kt,LaunchGateTest.kt,SendMonitorTest.kt— one tap fires once, taps during a send are dropped, process-wideTagRefusedTest.kt— the "Not supported" screenReceiveViewModelTest.kt,ReceiveQrContentTest.kt— wall-clock expiry, revoke on payment, hint placement at 227 and 192 dpLaunchRequestTest.kt,SendViewModelTest.kt,PaymentsRepoTest.kt— tag parsing, tap → Review, QuickPay on a tap, offline tap, own tag, a popped flow never QuickPaysEvidence
7ac718aad(rebased on feat: import the phone's settings and quickpay on the watch #2188's OK-button change):just compile,just test(with:wear:testDevDebugUnitTest --rerun),just lintall passed.Wear_Large_Round_API37(Wear OS 7) at7ac718aadagainst the local./sparkstack, and so did these journeys from feat: add wear payments and the self-send guard #2182 re-run undersingleTask:send-deeplink-bolt11,send-own-invoice-guard,send-offline-error,receive-qr,receive-paid,tile-balance,restore-background-drops-words. A link, a tap intent and the tile each left one task with oneMainActivity(dumpsys activity).NDEF_DISCOVEREDintent forbitcoin:…?req-foo=1showed "Not supported" (Preview).Gaps
ReceiveQrContentTest.kt.Models used
claude-opus-5-5(reasoning:medium)claude-fable-5-2(reasoning:medium),claude-opus-5-5(reasoning:medium)claude-fable-5-2(reasoning:medium),claude-opus-5-5(reasoning:medium)claude-sonnet-5-5(reasoning:medium)🤖 Generated with Claude Code