Skip to content

Add page-return and transaction handoff helpers - #4

Open
aaroncox wants to merge 2 commits into
masterfrom
handoff-helpers
Open

Add page-return and transaction handoff helpers#4
aaroncox wants to merge 2 commits into
masterfrom
handoff-helpers

Conversation

@aaroncox

@aaroncox aaroncox commented Aug 20, 2026

Copy link
Copy Markdown
Member

Adds helpers that let same-device signing flows survive iOS Safari suspending the page during an app handoff.

  • isSamePageReturn and waitForPageReturn detect the fragment-based return URL and resolve once the page returns to the foreground, via hashchange or a hidden-to-visible round trip.
  • TransactionHandoff with storeTransactionHandoff, findReturnedTransactionHandoff, and clearTransactionHandoff persists the callback channel and expected transaction identity in localStorage, with expiry and shape validation.
  • receiveReturnedTransaction lets whichever tab Safari opens receive the buffered callback from Buoy, verify it matches the stored identity, and reconstruct the signed transaction for broadcast. The caller supplies the ABI provider.

pako moved to dependencies since receiveReturnedTransaction uses it at runtime. 16 new tests cover the helpers. Published as 1.7.0-rc1 under the next tag.

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.

1 participant