Skip to content

feat: pay contacts via pubky swaps - #1732

Merged
ovitrif merged 30 commits into
masterfrom
feat/pubky-swaps-route
Nov 14, 2026
Merged

ovitrif merged 30 commits into
masterfrom
feat/pubky-swaps-route

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1826

Dependency: synonymdev/bitkit-core#182
Refs:

Description

  • Routes a Paykit contact payment through a Pubky Swaps provider when the contact's only endpoint is on-chain and savings is empty (at or below dust) while spending is not, so a wallet holding only spending can still pay that contact. The route is chosen when the contact opens, before the amount. The user never picks a swap: Bitkit asks bitkit-core's router for the route.
  • Finds providers in the user's own contact graph: every saved contact is asked for its swap offer over iroh, and those that run no provider are skipped. PUBKY_SWAPS_PROVIDERS adds extra candidates for testing.
  • Takes only signed quotes and contracts: bitkit-core negotiates over paykit-cap.* and refuses a reply not signed by the provider's key or the key its records delegate to.
  • Shows the route on the confirm screen as Route: Pubky Swaps · <provider>, with the whole swap cost in the fee row.
  • On swipe, commits the quote, pays the provider's hold invoice from spending, and waits until bitkit-core has claimed the provider's on-chain lock straight to the contact's address. The contact receives exactly the amount entered.
  • Once the hold invoice is paid, waits on it on the Pending screen, with no way back to a fresh quote that could pay twice. Shows Bitcoin Sent when the hold payment settles, which the provider does on seeing the claim, with the contact on its activity. A failed hold payment, or a swap bitkit-core failed, shows the payment error screen with Retry from Amount. The claim keeps advancing in the background for up to an hour while the app runs, and a claim not broadcast within 10 minutes leaves the send pending.
  • After a wallet restore from the seed, rebuilds the swap routes the wallet left in flight from each provider's listing, claims them to a fresh Savings address (the contact's address does not survive the restore), and tells the user the payment was returned to Savings. The restore passes the Lightning payments the node sent, so bitkit-core checks each listed lockup against what was paid. Swaps already on record are driven too, without that notice, since they keep the contact's address.
  • Behind PUBKY_SWAPS_ROUTES=true on regtest debug builds only.

Builds against the bitkit-core release 0.8.0-rc15, which includes synonymdev/bitkit-core#182. Master's Spark leg (#1754) goes first. A contact payment to an on-chain address takes the swap route when Spark can't carry it, including when Spark's balance is too small for the amount and fee: that's the order bitkit-core's router weighs service legs and swaps in. A send that only a swap pays skips the Paykit router on Amount and Confirm, so it never picks up a Spark leg next to its quote.

Why this journey

  • Paying a contact over a rail you don't hold is the journey Pubky Swaps supports today, in its Bitcoin form: a Lightning balance pays a contact who only accepts on-chain.
  • The USDT forms (paying a USDT endpoint from bitcoin, or receiving bitcoin from a USDT payer) are blocked: Pubky Swaps is Bitcoin and Lightning only, so USDT needs a second, provider-trusted leg such as NEAR 1Click, which has no testnet (Paykit Capabilities §13.1).
  • Auto-pay on the cheapest route comes next: it is this router plus the allowance executor, which today pays only Bolt11 and on-chain, and it needs two or more providers to compare.

What it needs to ship

  • Providers: mainnet Pubky Swaps providers with Lightning and on-chain liquidity among users' contacts. Asking every contact for an offer tells each of them you are looking for a swap (no amount or destination); published Capability Descriptors would replace the probing.
  • swap/1 in Paykit: the signed paykit-cap.* negotiation runs over iroh; over Paykit Encrypted Links it needs the additive paykit-rs SDK API for extension kinds (Design review: Paykit Capabilities, a general capability and intent layer for Paykit peers (answers Paykit Intents question 8) pubky/paykit-rs#229, §17).
  • Backup of swap state: swap records are not in the wallet backup; a restore rebuilds them from providers' listings. If the app stops between paying and claiming, nothing resumes the claim yet; the funds come back through the timeouts (the provider cancels its hold invoice, or refunds its own lock). A restore made while a payment was still pending has to run again once it settles.
  • Fees: the fee row shows the provider's service fee, its on-chain cost and the wallet's claim fee under the Lightning "Instant" label, which reads as a Lightning fee. Lightning routing to the provider is on top. The claim fee rate is fixed at 2 sat/vB and should come from Bitkit's fee estimates.
  • iOS: the same flow on feat: pay contacts via pubky swaps bitkit-ios#1170.

Out of Scope

Design

N/A — no design available.

Preview

A wallet with only a spending balance pays a contact who accepts only on-chain bitcoin. The router finds a Pubky Swaps provider among the wallet's contacts, the confirm screen shows the route, the quote and contract are signed, and the contact receives exactly 20,000 sats on chain (Android emulator (API 35), 2x speed, regtest).

android-signed-swaps-route-2x.mp4

After a wallet restore from the seed, the swap the wallet left in flight before its claim is found at its provider and claimed to Savings, with the "Payment returned to Savings" notice (Android emulator (API 35), 2x speed, regtest; the phrase entry is not recorded). Recorded on bitkit-core 0.8.0-swaps.4, before restores took the node's payments.

android-restore-j2c2x.mp4

QA Notes

Setup

  • Chain and provider: feat: local pubky swaps provider bitkit-docker#39, README "Pubky Swaps" (branch feat/pubky-swap-provider until it merges): the stack, the pubky-swaps profile with the provider at f45e204 on the stack's LND, the marketplace and fixture-issuer fixtures, and the LNURL-pay fixture. docker compose logs pubky-swap | grep "Provider pubky" gives the provider's pubky.
  • App: E2E=true E2E_BACKEND=local E2E_LOCAL_HOST=127.0.0.1 E2E_HOMESERVER_PUBKY=$(./pubky-marketplace info | jq -r .homeserver_z32) PUBKY_SWAPS_ROUTES=true ./gradlew assembleDevDebug. Before first launch, adb reverse 6286, 6287, 6288, 15411, 15412, 60001, 23735, 23000 and 23010.
  • Wallet: a new wallet; open the LNURL channel from curl -H 'Host: 127.0.0.1:23010' 127.0.0.1:23010/generate/channel (500,000 sats to spending); leave savings empty; create a Pubky profile; save the provider's pubky and the fixture-issuer's pubky as contacts.
  • Contact: bitkit-docker's fixture-issuer (curl 127.0.0.1:23012/health gives its pubky), which publishes only btc-regtest-p2wpkh.

Journeys

  • J1: new paykit-swap-route.xml — a spending-only wallet pays an on-chain-only contact through a Pubky Swaps provider found among its contacts, and the contact receives exactly 20,000 sats
  • J2: new paykit-swap-restore.xml — a swap route left in flight before its claim is finished after a wipe and a restore from the recovery phrase: claimed to Savings, with the "Payment returned to Savings" notice

Manual Tests

N/A

Automated Checks

  • updated AppViewModelSendFlowTest.kt — the routed send: it finishes once, as the hold payment's success, and tags the hold payment; quote, hold-payment and claim failures, and a hold-payment failure event ending the wait; a Direct answer moving to Savings; quotes from a replaced send or wallet dropped; Spending selectable for a swap-routed contact; the endpoint's method id matching its address; a stale amount or fee after edits; a late claim or failure after dismissal leaving the next send alone; a failed payment retrying from the amount with a fresh quote
  • added PubkySwapsRouteRepoTest.kt — the claim wait finishes on broadcast, retries a failed advance, and keeps advancing a swap whose wait ran out
  • updated WalletViewModelTest.kt — swap restore after a wallet restore, with the restore's failed categories; swaps already on record driven without the Savings notice
  • ran detekt and testDevDebugUnitTest for WalletViewModelTest, AppViewModel* and PubkySwaps* at 4b8c8df: pass

Evidence

  • J1 and J2 at 098c35550 (bitkit-core 0.8.0-rc14) on a regtest emulator (API 35), against feat: local pubky swaps provider bitkit-docker#39's stack, with no PUBKY_SWAPS_PROVIDERS: both pass. Recordings, claim txids and notes are in feat: pay contacts via pubky swaps #1732 (comment).
  • J1 via the saved issuer contact at a786e349e, against feat: local pubky swaps provider bitkit-docker#39 with its rc8 fixture-issuer: passes. Confirm showed the contact as TO and the Pubky Swaps route; the recording and claim txid are in feat: pay contacts via pubky swaps #1732 (comment).
  • J1 at 9f6ec3b on a regtest emulator (API 35), bitkit-core 0.8.0-swaps.9, provider coreyphillips/pubky-swap f45e204 with --no-homeserver, and no PUBKY_SWAPS_PROVIDERS, so the provider came only from the wallet's contacts (the recording above):
    • the confirm screen showed Route: Pubky Swaps · pubky…fez6y and a fee of ₿ 986 for 20,000 sats;
    • the provider's record of the swap holds the contract signed over the wallet's commit, signed by its own key;
    • the provider logged hold invoice accepted, HTLC funded; awaiting client claim and, after one block, client claimed; hold invoice settled;
    • the claim, d953772e4480f719bbf843f6df2015dd7befab453ef8d1944398f07c2abdb6c6, has one input, the provider's HTLC, and one output of exactly 0.0002 BTC to the contact's address.
    • The contact was paid as a pubky entered on the Send screen: the fixture-issuer gets a new pubky when it restarts, so the saved contact pointed at its old identity and stalled on "Encrypted Link Handshake is still in progress". That is a fixture artefact, unrelated to the route; that such a contact retries instead of failing fast is existing behaviour on master, tracked in bug: saved contact payment stalls instead of failing #1827.
  • J2 on a regtest Android emulator (API 35) at 257190c, bitkit-core 0.8.0-swaps.4, provider coreyphillips/pubky-swap main with --no-homeserver:
    • the swap was started, the provider logged "HTLC funded; awaiting client claim", and the app was killed before any block; the wallet was then wiped and restored from its throwaway regtest recovery phrase;
    • the restore listed the swap at the provider, the claim went out after one block, and the provider logged "client claimed; hold invoice settled";
    • Savings went from 0 to ₿ 20,000, the "Payment returned to Savings" notice showed, and the swap's activity turned to Sent.
    • In the first take the claim (2d3aa3d…b577) had one input, the provider's lockup, and one output of exactly 0.0002 BTC to the wallet's own address. That take also showed the notice hidden under the "Received Bitcoin" sheet the claim opens, so it now stays until dismissed (257190c).
    • The build set PUBKY_SWAPS_PROVIDERS to the provider, in case contacts had not reloaded when the restore ran; they had, and the provider was also among them.
  • J1 earlier at 46ad2a9, before quotes were signed on a regtest emulator (Android 15), with feat: pubky swaps as paykit route bitkit-core#182 at 3fd9e9d and no PUBKY_SWAPS_PROVIDERS, so the provider came only from the wallet's contacts (the recording above):
    • the confirm screen showed Route: Pubky Swaps · pubky…mpquo and a fee of ₿ 986 for 20,000 sats;
    • the provider logged hold invoice accepted, HTLC funded; awaiting client claim and, after one block, client claimed; hold invoice settled;
    • the claim transaction has one input, the provider's HTLC, and one output of exactly 0.0002 BTC to the contact's address;
    • the success screen shows the wallet's debit of ₿ 20,986.
  • Three earlier runs of the same journey, with the provider passed through PUBKY_SWAPS_PROVIDERS, paid the same way.

Gaps

  • The provider's contact entry has no Pubky profile, so the route shows its key rather than a name.

Models used

  • Planning/scoping: claude-opus-5-5 (reasoning: medium), claude-sonnet (reasoning: Not exposed)
  • Implementation: claude-opus-5-5 (reasoning: medium)
  • Review: Not performed

Metadata note: the Sonnet entry is the research subagent that read pubky-swap and Bitkit's Paykit code; its exact model version is not exposed in this session's records.

@ovitrif ovitrif self-assigned this Oct 29, 2026
@ovitrif ovitrif mentioned this pull request Nov 2, 2026
22 tasks
@ovitrif

ovitrif commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 97749ce: moves to bitkit-core 0.8.0-swaps.3, whose Paykit router takes service legs (synonymdev/bitkit-core#184).

  • Passes no service legs yet, so routing behaves as before; the Spark leg comes in feat: pay contacts via spark #1754.
  • Handles the router's new Service route, which cannot be returned while no legs are passed.
  • AppViewModelSendFlowTest and just lint pass.

@ovitrif

ovitrif commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed f6f8ad3be: after a wallet restore, rebuilds in-flight swap routes from each provider's listing (bitkit-core 0.8.0-swaps.4, pubky_swaps_restore from synonymdev/bitkit-core#182).

  • Restored swaps claim to a fresh Savings address, since the contact's address isn't in the listing. Once a claim confirms, a toast tells the user the payment was returned to Savings. The two strings are added in every locale.
  • New WalletViewModelTest cases: swaps are restored once a wallet restore completes, and left alone while swap routes are off. WalletViewModelTest, AppViewModelSendFlowTest and just lint pass. Not covered yet: a device run of the restore path.

@ovitrif

ovitrif commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed 257190c: the "Payment returned to Savings" notice now stays until dismissed. On a device run, the "Received Bitcoin" sheet that the claim opens covered it, and it hid before the sheet closed. Also adds the paykit-swap-restore.xml journey (J2), recorded on a regtest emulator: a swap left in flight before its claim is finished after a wipe and restore, and claimed to Savings. The recording and evidence are in the description.

@ovitrif ovitrif changed the title feat: pay contacts through pubky swaps feat: pay contacts via pubky swaps Nov 3, 2026
ovitrif added a commit that referenced this pull request Nov 5, 2026
Rebuilt on the split Spark head; carries the Pubky Swaps route (#1732) as it was merged into this branch.
# Conflicts:
#	app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt
Restore passes the Lightning payments the node sent, so bitkit-core checks each listed lockup against what was paid, and drives the swaps already on record too.
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from a786e34 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@ovitrif
ovitrif marked this pull request as ready for review November 9, 2026 21:02
@ovitrif
ovitrif requested review from a team and coreyphillips and removed request for a team November 9, 2026 21:02
# Conflicts:
#	app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt
#	app/src/test/java/to/bitkit/ui/WalletViewModelTest.kt
#	gradle/libs.versions.toml
@ovitrif

ovitrif commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

Moved bitkit-core from the 0.8.0-swaps.11 prerelease to the 0.8.0-rc14 release in 9a7eebe, now that synonymdev/bitkit-core#182 is merged. rc14's regtest calls take a new auth argument with no Kotlin default, so CoreService passes null and keeps today's calls.

Then merged master in 46948b6. WalletViewModel and its test take both the swaps route repo and master's SparkRepo; the versions keep rc14 and take master's breez-sdk-spark and paykit. Nothing else changed, so a re-approval is needed only because of the dependency bump and the base merge.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review of the rebase onto master (7c56d7a9c, 46948b65b) and 9a7eebeb3 (bitkit-core 0.8.0-rc14): one LOW, inline.

  • Core: 0.8.0-swaps.11 is an ancestor of rc14, and pubky_swaps and paykit_route are identical between them. 9a7eebeb3 only adds auth = null to the four regtest calls.
  • Route types: PubkySwapsRouteRepo.kt:83-91 sets all seven PaykitRouteRequest fields, and AppViewModel.kt:4715-4737 handles all four PaykitRoute cases.
  • Merges: the conflicts are in libs.versions.toml (rc14 plus master's breez-sdk-spark and paykit rc7) and the WalletViewModel constructor, which keeps both pubkySwapsRouteRepo and sparkRepo. The swap files are byte-identical to cd13b132.
  • The LOW: Spark arriving from master now reaches the hold payment (inline). A restore also matches lockups only against node payments (PubkySwapsRouteRepo.kt:123-124), so a Spark-paid swap left mid-flight refunds instead of being claimed. That loses nothing, so I'm not raising it separately.

The LOW can be fixed here or moved to a follow-up issue, your choice; please say which on the thread.

⚠️ Device gate: still not run — J1/J2 need the pubky-swap provider (coreyphillips/pubky-swap f45e204) against bitkit-docker's LND and the marketplace stack. CI: build, build-and-test, lint, detekt, compose-ui and five e2e shards pass; two shards were still running.

Reviewer model: Claude Fable 5.2 (claude-fable-5-2), Claude Opus 5.5 (claude-opus-5-5)
Reasoning effort: not exposed

@ovitrif
ovitrif requested a review from jvsena42 November 11, 2026 15:16
@jvsena42

Copy link
Copy Markdown
Member

@ovitrif this conflicts with master again; please rebase. I'll review it again once it merges cleanly.

@ovitrif

ovitrif commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@jvsena42 merged master again in c866eb5 (a merge, so reviewed commits keep their shas). The only conflict was the bitkit-core line in gradle/libs.versions.toml, which stays on 0.8.0-rc14; master's biometric and Gradle wrapper bumps come in unchanged.

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/to/bitkit/services/CoreService.kt
@ovitrif

ovitrif commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@jvsena42 merged master in 098c355, which now has its own rc14 bump and regtest auth (#1867). This PR takes master's Env.blocktankRegtestAuth in place of its auth = null, so the bitkit-core pin and CoreService now match master; app/build.gradle.kts keeps both the swap route fields and BLOCKTANK_REGTEST_AUTH.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review of c22b8f6ed and the master merges c866eb5dc/098c35550: my LOW is fixed (confirmed on the thread), and nothing new.

098c35550 resolves its two conflicts correctly. build.gradle.kts keeps the swap BuildConfig fields (PUBKY_SWAPS_ROUTES, PUBKY_SWAPS_PROVIDERS) and master's BLOCKTANK_REGTEST_AUTH. The four regtest calls in CoreService.kt take master's auth = Env.blocktankRegtestAuth instead of the branch's auth = null. c866eb5dc only resolves libs.versions.toml.

⚠️ Device gate: still not run — J1/J2 need the pubky-swap provider (coreyphillips/pubky-swap f45e204) against bitkit-docker's LND and the marketplace stack.

Reviewer model: Claude Opus 5.5 (claude-opus-5-5)
Reasoning effort: not exposed

@ovitrif

ovitrif commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

QA: J1 and J2 pass at 098c355, on a regtest Android 15 emulator (API 35). The stack is synonymdev/bitkit-docker#39's pubky-swaps profile: the Pubky Swaps provider at f45e204 on bitkit-docker's LND and Electrum, plus the marketplace and fixture-issuer fixtures. The wallet found the provider only among its contacts (no PUBKY_SWAPS_PROVIDERS).

J1: paykit-swap-route.xmlJ2: paykit-swap-restore.xml
android-j1-paykit-swap-route-2x.mp4
android-j2-paykit-swap-restore-2x.mp4

J1, Spending only (500,000 sats, Savings 0), paying the on-chain-only fixture-issuer 20,000 sats:

  • Confirm showed Route: Pubky Swaps · pubky…t6kgy with a fee of Instant (± ₿ 1 265).
  • The provider logged hold invoice accepted, HTLC funded; awaiting client claim and, after one block, client claimed; hold invoice settled.
  • The claim, f215079456169881ec8b4decf3f51190176124dd420c488245af46c7a59ded20, spends only the provider's HTLC and pays exactly 0.0002 BTC to the issuer's address.
  • Spending went from 500,000 to 478,735 (20,000 plus the 1,265 fee), and the success screen shows ₿ 20,000.

J2: the swap was started, the provider funded its HTLC, and the app was killed before any block. Then the app data was cleared and the wallet restored from its recovery phrase:

  • The restore found the swap with no provider configured in the build.
  • After one block the claim went out, and the provider logged client claimed; hold invoice settled.
  • The claim, 1ae83d8ea5f9250e1c5fc75492aecafb84ab16bc96b92659ea0376f5166cf42d, pays exactly 0.0002 BTC to the restored wallet's own address.
  • Savings shows ₿ 20,000, the "Payment returned to Savings" notice shows, and the swap's activity is Sent 21,265.

Not as written:

  • J1 step 3 paid the issuer by its pubky through Enter Manually, not as a saved contact: the stack's issuer then ran an older Paykit. The rerun via the saved contact on the rc8 issuer passes: feat: pay contacts via pubky swaps #1732 (comment).
  • The recordings come from the plain recorder, not the smooth one, because the AVD's status bar did not match the media check.
  • Because the issuer was paid by pubky with no saved contact, both swap activity rows carry the swap's memo pubky-swap reverse <id> instead of a contact.

@jvsena42

Copy link
Copy Markdown
Member

@ovitrif this conflicts with master; please rebase. I'll review it again once it merges cleanly.

# Conflicts:
#	app/src/main/java/to/bitkit/ui/screens/wallets/send/SendConfirmScreen.kt
#	app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt
#	app/src/main/res/values/strings.xml
#	app/src/test/java/to/bitkit/viewmodels/AppViewModelSendFlowTest.kt
@ovitrif

ovitrif commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

@jvsena42 merged master in as a786e34 (a merge rather than a rebase, so the reviewed commits stay as they are), and it merges cleanly now. Master's Spark contact payments (#1754) and this PR's swap route now share a send the way they do on iOS (synonymdev/bitkit-ios#1170):

  • A contact payment to an on-chain address takes Spark's leg first. The swap route covers what Spark can't pay: too small a balance for the amount and fee, or no route from Spending. In that case Continue quotes the swap instead of refusing.
  • A send that only a swap pays never goes through the Paykit router on Amount or Confirm, so it never picks up a Spark leg next to its quote.
  • Confirm shows the Pubky Swaps cell for a swap quote and the Spark cell for a service leg, and pays whichever is set.
  • New test: spark balance short of a contact payment falls back to a swap quote. AppViewModelSendFlowTest, WalletViewModelTest, PubkySwapsRouteRepoTest, PaykitRouteRepoTest and detekt pass.

@ovitrif
ovitrif requested a review from jvsena42 November 13, 2026 11:29
@ovitrif

ovitrif commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator Author

QA: J1 passes via the saved issuer contact at a786e34, on a regtest Android 15 emulator (API 35). The stack is synonymdev/bitkit-docker#39 with main merged in, so its fixture-issuer runs on Paykit rc8 (synonymdev/bitkit-docker#38).

J1 via the saved contact: paykit-swap-route.xml
j1-saved-contact.mp4

J1, Spending only (500,000 sats, Savings 0), paying the saved fixture-issuer contact 20,000 sats:

  • Send, then Contact, listed the issuer and the provider. Tapping the issuer opened the amount screen.
  • Confirm showed FROM Spending, TO the contact pubky…h33xo, Route: Pubky Swaps · pubky…t6kgy and a fee of Instant (± ₿ 1 265).
  • The provider logged hold invoice accepted, HTLC funded; awaiting client claim and, after one block, client claimed; hold invoice settled.
  • The claim, 47490607a1b78b6f70547446a3945edaa4d5f365c48b548fee28fc29cd7f6552, spends only the provider's HTLC and pays exactly 0.0002 BTC to the issuer's address.
  • Spending went from 500,000 to 478,735 (20,000 plus the 1,265 fee). The activity row is Sent to pubky…h33xo with the contact's avatar.

Setup: the issuer must be linked to the wallet and have sent it its private payment list before the tap. Without the list, the tap showed "The contact you're trying to send to hasn't enabled payments." synonymdev/bitkit-docker#39's README has the three calls.

@coreyphillips coreyphillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta review from de7b78f, my last review, to a786e34. Nothing blocking, two LOWs inline.

  • Fixes 8d40a8b to cd13b13 and c22b8f6. A hold payment that fails before payInvoice returns opens the error screen once, a refused commit retries from Amount and releases the private payment list, and an unknown Spark outcome stays pending. These read correctly.
  • The a786e34 merge carries new behaviour, so I read it as code rather than a conflict fix. The Spark leg and the swap route stay exclusive: Leg and Direct clear paykitSwapRoute, the None branch clears serviceLeg before it returns SwapFallback, the swap is paid before any service leg, the LNURL fetch and paysLnurl skip a swap quote, and the sanity check uses its debit. I found no path that pays both.
  • Test gap, non-blocking. spark balance short of a contact payment falls back to a swap quote covers Spark to swap. Nothing covers the way back that routePaykitPaymentOnContinue's doc names: a smaller amount entered after a swap quote takes the Spark leg and clears the quote.

@ovitrif

ovitrif commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

@coreyphillips thanks. The test gap is out of scope: tracked in #1922, with the two LOWs (#1920, #1921) for one follow-up PR after this one merges.

@ovitrif
ovitrif merged commit 42f4385 into master Nov 14, 2026
24 checks passed
@ovitrif
ovitrif deleted the feat/pubky-swaps-route branch November 14, 2026 02:17
@ovitrif

ovitrif commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Merged: approved at a786e34, CI green, no open threads. Corey's non-blocking points go into one follow-up PR (#1920, #1921, #1922). The iOS twin, synonymdev/bitkit-ios#1170, is still in review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: pay on-chain contacts from spending

5 participants