Skip to content

port: migrate to Smart Account Kit + OpenZeppelin Relayer (replaces retired passkey-kit + Launchtube) - #1

Closed
AshFrancis wants to merge 3 commits into
ElliotFriend:mainfrom
AshFrancis:main
Closed

port: migrate to Smart Account Kit + OpenZeppelin Relayer (replaces retired passkey-kit + Launchtube)#1
AshFrancis wants to merge 3 commits into
ElliotFriend:mainfrom
AshFrancis:main

Conversation

@AshFrancis

Copy link
Copy Markdown
Contributor

Hey @ElliotFriend — no expectations with this one; feel free to close if the direction isn't right for the repo. Sharing in case it's useful.

Why

stellar/launchtube is archived and the hosted service at launchtube.xyz is offline, so the current guestbook can't complete signup or transaction submission end-to-end. The Stellar docs tutorial that points at this repo has the same problem.

What

Ports the app to the current Stellar smart-wallet stack:

Notable simplifications:

  • Drops the Mercury/Zephyr reverse-lookup indexer — Smart Account Kit persists credential → contract mappings in IndexedDB.
  • No separate sign + send dance; kit.signAndSubmit(assembledTx) handles the whole passkey-signed submission.
  • SAC interactions (balance read, transfer) are built directly with stellar-sdk primitives rather than via a SAC wrapper, which turned out more stable under production bundling.

Testing

Live Testnet deploy exercising all flows (signup, login, fund, donate, write/edit messages, reconnect): https://ye-olde-guestbook.pages.dev

Related

Companion PR updating the Stellar developer docs: stellar/stellar-docs#2367

… Relayer

Replace the retired passkey-kit/Launchtube stack with the current
OpenZeppelin Smart Account + Channels relayer toolchain, and switch
hosting from Vercel to Cloudflare Pages so the relayer proxy can live
alongside the static app.

Client (src/lib/passkeyClient.ts):
- Drop the SACClient proxy; expose `account` (lazy SmartAccountKit),
  `send()`, `fundContract()`, plus `SAK_DEPLOYER_PUBLIC_KEY` for the
  shared simulation source.
- Dynamic-import smart-account-kit so server routes don't pull it.

Server (src/lib/server/relayer.ts):
- Route Soroban {func, auth} payloads to OZ Channels with Bearer auth.
- Route signed XDR envelopes to RPC directly (OZ rejects SAK's wallet-
  deploy fee as a mismatch, and the SAK deployer is pre-funded).

Routes:
- /api/send → /api/relay, proxy forwards to the new relayer module.
- /api/fund builds the SAC transfer + assembled tx by hand to dodge
  `contract.Client.from` / `TransactionBuilder.cloneFrom` issues under
  the Workers bundler; submits via RPC.

UI (components/ConnectButtons, GuestbookMessage, routes/sign):
- Signup uses `autoSubmit: true`; login uses `connectWallet({ prompt })`;
  donations build `AssembledTransaction.build(...)` with the smart
  account as `from` and the SAK deployer as stellar-sdk `publicKey`.
- Settings reads the SAC Balance entry directly from ledger storage.
- Wire up the Copy-address button; surface real error messages in toasts.

Misc:
- Drop unused deps (@openzeppelin/relayer-plugin-channels, @floating-ui,
  base64url, buffer) and the PUBLIC_FUNDER_PUBLIC_KEY env var.
- Remove the Jacquard-font preload that mismatched the CSS load timing.
- Switch to @sveltejs/adapter-cloudflare and document the Pages deploy
  flow + required env vars in the README.
@vercel

vercel Bot commented Apr 16, 2026

Copy link
Copy Markdown

@AshFrancis is attempting to deploy a commit to the elliotfriend's projects Team on Vercel.

A member of the Team first needs to authorize it.

Addresses Copilot review feedback on stellar-docs PR #2367:
`@sveltejs/kit`'s `error(...)` returns `never` (it throws), so
`return error(...)` reads confusingly. Swap to `throw error(...)`
for clarity. Re-throw HttpErrors in /api/relay's catch block so
client-side validation errors aren't re-wrapped as 502s.
ElliotFriend added a commit that referenced this pull request Sep 4, 2026
his PR on the guestbook repo served as a lot of prior art for this
upgrade and was indispensible when updating educational comments
throughout the codebase. this project is much better for the
contributions from him.

This commit specifically adapts his relayer proxy approach, the
env-file structure, and several explanatory comments.

Refs #1

Co-authored-by: Ash Francis <ash@ashfrancis.com>
@ElliotFriend

Copy link
Copy Markdown
Owner

merged a lot of this in with 6b78e46 (finally!)

thanks so much for the help!!!

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.

2 participants