Repository navigation
Guestbook updates - #1945
Guestbook updates#1945ElliotFriend wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Guestbook tutorial to reflect renamed templates, revised passkey setup, and newer Svelte components.
Changes:
- Removes Mercury setup and updates passkey workflows.
- Refreshes frontend examples and project links.
- Revises contract and bindings documentation.
Recommendation: NEEDS-CHANGES — Several examples are invalid or no longer match the linked project.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
smart-contract.mdx |
Clarifies contract types and behavior. |
setup-passkeys.mdx |
Revises passkey clients, server, and API routes. |
passkeys-prerequisites.mdx |
Removes Mercury prerequisites. |
overview.mdx |
Renames and relinks the starter template. |
frontend.mdx |
Updates Svelte components and passkey flows. |
bindings.mdx |
Restructures binding instructions and links. |
Suppressed comments (3)
docs/build/apps/guestbook/setup-passkeys.mdx:66
- The updated expression uses
Asset, but this snippet still imports onlySACClientand the now-unusedPUBLIC_NATIVE_CONTRACT_ADDRESS. As written, copying it producesAsset is not defined.
export const native = sac.getSACClient(
Asset.native().contractId(PUBLIC_STELLAR_NETWORK_PASSPHRASE),
);
docs/build/apps/guestbook/frontend.mdx:154
- The linked application's current
mainbranch migrated frompasskey-kit/Launchtube tosmart-account-kitand OpenZeppelin Channels on 2026-09-03, so this updated walkthrough still does not match the “actual project” named in the PR description. Either update the tutorial to the current architecture or pin every source link and setup instruction to the historical revision this content documents.
docs/build/apps/guestbook/frontend.mdx:596 user.keyIdisstring | null, but it is passed directly toaccount.sign. This copied snippet omits the project's guard, so it does not type-check and can attempt signing without an authenticated user.
message_id: messageId,
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const result = await rpc.getLedgerEntries(...ledgerKeysArray); | ||
| const messages = result.entries.map((message) => { | ||
| return { | ||
| ...scValToNative(message.val.contractData().val()), | ||
| }; |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. getAllMessages now returns MessageWithIndex and reads the ID out of the ledger key, like the project code does.
| // Send the transaction, and then fund the smart wallet | ||
| await send(signedTx); | ||
| await fundContract(user.contractAddress); |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. The signup snippet now guards user.contractAddress before it funds the wallet, like Signup.svelte does.
| try { | ||
| isLoading = true; | ||
| const at = await ye_olde_guestbook.write_message({ |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. signGuestbook now throws when keyId or contractAddress is missing, and submitEdit guards keyId. Both match the project code.
| let isEditing: boolean = $state(false); | ||
| let isLoading: boolean = $state(false); | ||
| let messageTitle = $state(message.title); | ||
| let messageText = $state(message.text); |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. There is one $state pair now, and cancelEdit sets isEditing.
| // The connectWallet function requires us to pass a function that can | ||
| // be used to reverse-lookup the smart wallet address, provided we know | ||
| // the passkey's ID (the user supplies that during the function's execution) |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct. Both spots are fixed. The login comment now describes address derivation, and the logout text no longer mentions the indexer.
| That's all there is to it! This `account` will be fully ready to authenticate users and sign transactions! (It's even easier than all the prerequisites isn't it!) | ||
|
|
||
| Now, we've also added some useful "helpers" into the `$lib/passkeyClient.ts` file in our template. The [source code file](https://github.com/ElliotFriend/soroban-template-sveltekit-passkeys/blob/main/src/lib/passkeyClient.ts) is commented to reflect what these helpers are, and how they work. These are strictly for convenience, though. You could stop right here and come away with perfectly valid signed passkey transactions. These helpers are: | ||
| Now, we've also added some useful "helpers" into the `$lib/passkeyClient.ts` file in our template. The [source code file](https://github.com/ElliotFriend/stellar-template-sveltekit-passkeys/blob/main/src/lib/passkeyClient.ts) is commented to reflect what these helpers are, and how they work. These are strictly for convenience, though. You could stop right here and come away with perfectly valid signed passkey transactions. These helpers are: |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, and only the author can fix it. ElliotFriend/stellar-template-sveltekit-passkeys still ships PUBLIC_NATIVE_CONTRACT_ADDRESS, the getContractId helper and send(xdr: string). Raised in a PR comment.
| #### `DataKey` | ||
|
|
||
| This is a struct that's used elsewhere in the contract to define the keys for the various storage entries the contract will hold. Nothing groundbreaking or remarkable here, to be honest, but it's still worth showing. The `Message(ID_NUMBER)` will be used as the key to store a `Message` struct on-chain as the corresponding value. | ||
| This is a struct that's used elsewhere in the contract to define the keys for the various storage entries the contract will hold. Nothing groundbreaking or remarkable here, to be honest, but it's still worth showing. The `Message(u32)` variant will be used as the key to store a `Message` struct on-chain as the corresponding value. |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. The text now calls DataKey an enum.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Suppressed comments (7)
Previously missed (2) — in code that hasn't changed since the last review.
docs/build/apps/guestbook/frontend.mdx:571
- Renaming the state variable to
isEditingleavescancelEdit()below assigning to the nonexistenteditingidentifier, so cancelling an edit throws instead of closing the form.
This issue also appears on line 573 of the same file.
The HTML of the page is outside of what we need to cover here, but suffice it to say when the user is editing an entry, the form fields behave pretty similar to the form on the "sign the guestbook" page. The functions are a bit more interesting, and more relevant to this tutorial.
docs/build/apps/guestbook/frontend.mdx:60
- This updated walkthrough still does not match the linked project's current implementation:
mainnow usessmart-account-kit,src/lib/smartAccountClient.ts, and a differentcreateWallet/submission flow rather than thispasskey-kitAPI. Because all source links targetmain, readers cannot reconcile these snippets with the advertised reference application. Either update the tutorial to the current app or pin every reference link and dependency to the compatible revision.
docs/build/apps/guestbook/setup-passkeys.mdx:65
Assetis not imported anywhere in this snippet, while the now-unusedPUBLIC_NATIVE_CONTRACT_ADDRESSimport remains. As written, readers who copy this helper getCannot find name 'Asset'; importAssetfrom the SDK and remove the obsolete environment-variable import.
export const native = sac.getSACClient(
Asset.native().contractId(PUBLIC_STELLAR_NETWORK_PASSPHRASE),
docs/build/apps/guestbook/setup-passkeys.mdx:213
createWallet()returnssignedTxas base64 XDR, so the newsend(signedTx)call passes a string here andtx.toXDR()throws. Let this wrapper accept the deployment XDR as well as built transactions.
export async function send(tx: Tx) {
return fetch('/api/send', {
method: 'POST',
body: JSON.stringify({
xdr: tx.toXDR(),
}),
docs/build/apps/guestbook/frontend.mdx:540
getAllMessages()above still returnsMessage[]and only spreads each storedMessage; the contract'sMessagetype has noidfield. Consequently every key andmessageIdhere isundefined(and the new sort comparesundefinedvalues). Extract the numeric ID from each ledger-entry key and include it in the returned objects before rendering bymessage.id.
<div class="space-y-4">
<h1 class="h1">Read the Book</h1>
docs/build/apps/guestbook/frontend.mdx:574
- These new state declarations duplicate
messageTitleandmessageTexta few lines below, so the shown component fails to compile with duplicate identifiers. Remove the old declarations and their now-inaccurate comment.
:::tip
docs/build/apps/guestbook/setup-passkeys.mdx:33
- The newly linked template file does not reflect the helpers shown in this page: its current
mainstill importsPUBLIC_NATIVE_CONTRACT_ADDRESS, exposessend(xdr: string), and includes the Mercury lookup helper removed here. A reader who clones the recommended template therefore starts with a materially different implementation. Update that template in lockstep, or link to a revision whose code matches this tutorial.
Now, we've also added some useful "helpers" into the `$lib/passkeyClient.ts` file in our template. The [source code file](https://github.com/ElliotFriend/stellar-template-sveltekit-passkeys/blob/main/src/lib/passkeyClient.ts) is commented to reflect what these helpers are, and how they work. These are strictly for convenience, though. You could stop right here and come away with perfectly valid signed passkey transactions. These helpers are:
| The stripped-down basics of the component is simple enough: | ||
|
|
||
| ```html title="src/lib/components/connectButtons.svelte" | ||
| ```html title="src/lib/components/ConnectButtons/ConnectButtons.svelte" |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. The link now points at src/lib/components/ConnectButtons/ConnectButtons.svelte, which returns 200. I checked every other source link on these pages, and they all resolve.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Suppressed comments (5)
Previously missed (3) — in code that hasn't changed since the last review.
docs/build/apps/guestbook/frontend.mdx:28
- The updated prose says signup, login, and logout live in child components, but this parent-component snippet still calls three handlers that are not defined here. A reader following the new component layout gets unresolved identifiers; render the child components instead.
docs/build/apps/guestbook/frontend.mdx:547 Switchis a compound Skeleton component; the root alone does not render an interactive control. WithoutSwitch.Control,Switch.Thumb, andSwitch.HiddenInput, users cannot toggle it andonCheckedChangewill not fire.
docs/build/apps/guestbook/setup-passkeys.mdx:65- This snippet now calls
Asset.native(), but it still imports the removed environment variable and never importsAsset, so readers copying it getCannot find name 'Asset'. ImportAssetfrom the Stellar SDK instead.
docs/build/apps/guestbook/frontend.mdx:24
- After moving this component into the
ConnectButtonsdirectory, the source link below still targets the removedsrc/lib/components/ConnectButtons.sveltepath and now returns 404. Point it at the nested file shown by this fence title.
```html title="src/lib/components/ConnectButtons/ConnectButtons.svelte"
docs/build/apps/guestbook/bindings.mdx:115
- The linked template's
initialize.jsdeploys every Wasm without constructor arguments, so after readers add this guestbook contract its requiredadmin,title, andtextarguments makepnpm run setupfail. Document the required customization or use the guestbook project's constructor-aware initialization script before presenting this as an automated path.
You can always customize this script to suit your needs. Check out the [source code here](https://github.com/ElliotFriend/stellar-template-sveltekit-passkeys/blob/main/initialize.js) (which has been documented with comments). Or, you can see the [officially maintained script](https://github.com/stellar/soroban-template-astro/blob/main/initialize.js) in the [`soroban-template-astro` repository](https://github.com/stellar/soroban-template-astro), as well.
| stellar contract deploy \ | ||
| --source-account <identity or secret key> \ | ||
| --network testnet \ | ||
| --wasm-hash <wasm_hash_from_install_step> |
There was a problem hiding this comment.
🤖 Automated message from Kaan's Automated Triage Bot.
Correct, fixed. __constructor takes admin, title and text, so the deploy command now passes them after the -- separator. The automated path uses the template's initialize.js, which is out of this repo.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Suppressed comments (4)
Previously missed (3) — in code that hasn't changed since the last review.
docs/build/apps/guestbook/frontend.mdx:60
- This updated signup flow still does not match the linked current project: the project now uses
SmartAccountKit, andcreateWalletreturnsfundResult/submitResultwhile handling submission and funding through options. ThesePasskeyKitreturn fields and the subsequent manualsend/fundContractflow are absent there. Since this PR is intended to align the tutorial with the actual project, update the walkthrough consistently or pin all project links to the matching historical revision.
docs/build/apps/guestbook/frontend.mdx:492 - This accumulates every message key into one RPC request even though
getLedgerEntriesenforces the documented 200-key maximum. Once the guestbook reaches message ID 202, the call sends 201 keys and fails withInvalidParams; batching also avoids issuing an empty request when only the welcome message exists.
docs/build/apps/guestbook/frontend.mdx:548 - Skeleton's
Switchis a compound component, but this snippet omitsSwitch.Control,Switch.Thumb, andSwitch.HiddenInput. Consequently it lacks the actual visual/keyboard-operable control and hidden form input; placing text directly under the root is not a complete switch. Use the required subcomponents, as the linked project does.
docs/build/apps/guestbook/setup-passkeys.mdx:65
- This replacement calls
Asset.native()without importingAsset, while the preceding snippet still imports the now-unusedPUBLIC_NATIVE_CONTRACT_ADDRESS. As written, readers assemblingpasskeyClient.tsgetCannot find name 'Asset'.
export const native = sac.getSACClient(
Asset.native().contractId(PUBLIC_STELLAR_NETWORK_PASSPHRASE),
| export const server = new PasskeyServer({ | ||
| rpcUrl: PUBLIC_STELLAR_RPC_URL, | ||
| launchtubeUrl: PUBLIC_LAUNCHTUBE_URL, | ||
| launchtubeJwt: PRIVATE_LAUNCHTUBE_JWT, | ||
| mercuryUrl: PUBLIC_MERCURY_URL, | ||
| mercuryJwt: PRIVATE_MERCURY_JWT, | ||
| // mercuryKey: PRIVATE_MERCURY_KEY, // optionally | ||
| launchtubeHeaders: { |
|
🤖 Automated message from Kaan's Automated Triage Bot. I merged main, fixed the snippet defects and answered every Copilot thread. Three things need you:
Build and mdx-format are green. The preview job passed, but its host returns 404 on every path, so I used the build as the render evidence. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
docs/build/apps/guestbook/frontend.mdx:60
- This no longer matches the “actual project” named by the PR: the linked
ye-olde-guestbookmain branch now uses$lib/smartAccountClient/SmartAccountKit, and its signup flow callscreateWallet(..., { autoSubmit: true, autoFund: true });$lib/passkeyClientis absent. The currentpasskey-kitrelease also has breaking signing/configuration APIs, so these floatingmainlinks now mix incompatible implementations. Update the tutorial and template dependency together, or pin every clone/source link to a compatible revision.
docs/build/apps/guestbook/setup-passkeys.mdx:66 - This replacement calls
Asset.native()without importingAsset, while the snippet still imports the now-unusedPUBLIC_NATIVE_CONTRACT_ADDRESS. A reader assemblingpasskeyClient.tswill getCannot find name 'Asset'. ImportAssetfrom the Stellar SDK and remove the obsolete environment import.
|
superseded by #2837 |
|
PR Preview: torn down |
* Modernize smart-wallets references + rewrite guestbook tutorial Stellar's smart-wallets docs still point at the retired passkey-kit + Launchtube stack. Launchtube's repo is archived and the hosted service is offline, so the existing guestbook tutorial can't be completed as written. Update the canonical references to the current stack: - passkey-kit → Smart Account Kit (https://github.com/kalepail/smart-account-kit) - OpenZeppelin Smart Account contracts (audited signer/policy framework) - Launchtube → OpenZeppelin Relayer (Stellar Channels plugin) Changes: - build/guides/contract-accounts/smart-wallets.mdx: rewrite the Tooling section. Lead with the current stack; flag passkey-kit + Launchtube as legacy with a pointer at the retirement. - build/guides/contract-accounts/advanced-patterns.mdx: add Smart Account Kit alongside the OZ + Crossmint reference implementations. - build/apps/guestbook/*: rewrite the 6-page tutorial against the new stack. The companion app is now a Cloudflare Pages deployment that uses Smart Account Kit + the OZ Channels relayer via a same-origin /api/relay proxy, so the API key stays server-side. The reference app lives at https://github.com/AshFrancis/ye-olde-guestbook (live: https://ye-olde-guestbook.pages.dev). * docs: address Copilot review feedback on guestbook tutorial - throw `error(...)` instead of returning it in /api/relay, /api/fund, and /read/[id] snippets (SvelteKit's `error()` throws; `return` is misleading). - Add goto/resolve imports to signGuestbook snippet so readers copying it don't hit missing imports. - Overview: "fill in three things" → "two" (matches the .env snippet underneath, which has two vars). - Reword the relayer-key warning: we use Bearer auth, not URL-path auth, so the original phrasing was misleading. * docs: show PRIVATE_RELAYER_BASE_URL in overview .env snippet Per Copilot feedback: the earlier snippet omitted PRIVATE_RELAYER_BASE_URL and only mentioned two variables to fill in, even though relayer.ts reads a third. Include it with its Testnet default so a reader who stays on the overview page has a complete picture of the relayer-related env vars. * docs: follow the moved SDK repos and fix the funder secret command kalepail/smart-account-kit and kalepail/passkey-kit are both archived and now live under the stellar org. Point every link at the new homes. The CLI has no `stellar keys show` subcommand; the one that prints a secret key is `stellar keys secret`. * docs: carry over guestbook contract and bindings fixes from #1945 Accuracy fixes that are independent of the smart-account stack, so they survive the rewrite: the contract uses `__constructor` (not `initialize`), `DataKey` is an enum, and the deploy command needs its constructor arguments after the `--` separator. Refs #1945 Co-Authored-By: Kaan Kacar <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: re-aim the guestbook tutorial at the current app Ash Francis's rewrite in #2367 targeted smart-account-kit 0.2.10 on Cloudflare Pages. ye-olde-guestbook now runs ^0.6.2 on Vercel, so point the pages at what the app actually does: /api/send rather than an /api/relay Pages Function, smartAccountClient.ts rather than passkeyClient.ts, the kit's autoFund and fundWallet rather than a funder G-account, and kit events rather than localStorage. Correct the indexer story while we're here. The kit defaults to Mercury's hosted smart-account-indexer, so the reverse lookup did not disappear with Launchtube, it just stopped being something you deploy yourself. Draw that boundary explicitly, since conflating the two breaks returning-user login on an unseen device. Refs #2367, #1945 Closes #2700 Co-Authored-By: Ash Francis <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: use the workspace protocol for the guestbook bindings package ye-olde-guestbook keeps its bindings in a pnpm workspace now, so `pnpm add file:./packages/ye_olde_guestbook` no longer reflects what the repo does. Use `pnpm add -D ye_olde_guestbook --workspace`, which records `workspace:*` the way the app's package.json does. Replace the nested `cd packages/... && pnpm install && pnpm run build` with the workspace housekeeping initialize.js actually performs: drop the standalone lockfile the CLI emits, and set a `prepare` script so pnpm compiles the bindings on install. Refs #2837 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: match the automated bindings list to what initialize.js does The manual method now covers the pnpm workspace housekeeping, but the automated section's bullet list stopped at "generate bindings", so the two no longer described the same work. Name the prepare script, the dist/ gitignore, and the standalone lockfile removal, and correct the deploy bullet to mention the compile step. Refs #2837 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: trim the guestbook frontend walkthrough to the parts that teach The code blocks reproduced whole Svelte components, so only about 14% of their lines touched Smart Account Kit or the network. Two blocks (the sign-page form markup and the read/[id] component) had no Stellar content at all, and the form markup opened the tutorial's main event. Drop those two, trim the toast and loading-state ceremony from the rest, and mark every omission with a `// ...omitted:` comment naming what is gone. Lessons that the prose was narrating now live in code comments, so the signup section loses a paragraph that restated its own snippet. 311 code lines become 232 across 11 blocks rather than 13. Refs #2837 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: keep the guestbook section description short enough to be usable The stack links were appended to the intro paragraph, which the llms plugin takes as the page description. That pushed it from 273 to 578 characters and tripped a build warning. Split the stack into its own paragraph. Refs #2837 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: tighten the guestbook relayer proxy origin check Match the origin exactly rather than by substring, and explain why the forwarded payload is wrapped in `params` when the relayer guide's SDK examples aren't. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: drop migration framing from guestbook passkey prerequisites The page spent most of its length contrasting the current setup with the retired Launchtube and self-hosted Zephyr approach, which means nothing to a first-time reader. Describe the relayer, the funding helper, and the hosted indexer in the present tense instead, keeping the point that Mercury is still doing the credential-to-address lookup even though nobody configures it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix old-style admonition title * docs: describe the guestbook tooling without the before-and-after A first-time reader has no memory of Launchtube or of an earlier draft of this tutorial, so framing the current setup as a departure from those only adds noise. One pointer to passkey-kit stays in the overview for readers arriving from an older demo, and the smart wallets guide still carries the full predecessor mapping. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: correct what the guestbook relayer proxy passes through The kit treats a submission as successful only when the response status is ok and the body carries a top-level `success: true`, so the route cannot accept a bare transaction result the way the page claimed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: cover the kit's connection-verification failures connectWallet() verifies provenance, contract code, and signer state before it connects, and a failed check throws rather than connecting. "Try again later" is misleading advice for most of them. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: compile the guestbook bindings explicitly, not via prepare pnpm skips lifecycle scripts when an install has no work to do, which leaves dist/ missing on a warm build cache. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: scope the guestbook testing caveat to the frontend The smart contract has a test suite; the frontend is the part with no automated testing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs: bound guestbook RPC reads and clarify tutorial claims * docs: sync guestbook snippets with the SvelteKit 3 app - move imports to `#lib` and `$app/env/*`, and pass string messages to `error()` - check the `cause` of wrapped passkey dismissals - drop the batching caveat now that the app reads in batches of 200 Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: describe passkey-kit as a sibling of smart-account-kit Refs #2700 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Ash Francis <[email protected]> Co-authored-by: kaankacar <[email protected]> Co-authored-by: Kaan Kacar <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: kalepail <[email protected]>
various updates to keep the tutorial in line with the actual project.