Skip to content

feat(sdk): add Svelte adapter with writable store and SvelteKit example - #191

Closed
Muhammadcodes112 wants to merge 5 commits into
Miracle656:mainfrom
Muhammadcodes112:feat/sdk-svelte-adapter
Closed

feat(sdk): add Svelte adapter with writable store and SvelteKit example#191
Muhammadcodes112 wants to merge 5 commits into
Miracle656:mainfrom
Muhammadcodes112:feat/sdk-svelte-adapter

Conversation

@Muhammadcodes112

Copy link
Copy Markdown

Summary

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • Tests
  • CI / tooling

Component

  • Wallet frontend
  • SDK
  • Contracts
  • Agent

Checklist

  • I have read CONTRIBUTING.md
  • cargo test passes (contracts)
  • npm run typecheck passes (wallet / sdk / agent)
  • npm run build passes (wallet / agent)
  • I added or updated tests where relevant
  • I updated docs / README where relevant

Closes #174

@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented May 27, 2026

Copy link
Copy Markdown

@Muhammadcodes112 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Strong work on the architectural refactor — extracting InvisibleWalletCore so framework-specific adapters can share the logic is the right pattern. Two blockers before merge:

1. Compiled output is committed (must remove)

The diff includes 12 generated files under sdk/svelte/dist/:

sdk/svelte/dist/src/InvisibleWalletCore.{d.ts,js}
sdk/svelte/dist/src/__tests__/useInvisibleWallet.test.{d.ts,js}
sdk/svelte/dist/src/index.{d.ts,js}
sdk/svelte/dist/src/useInvisibleWallet.{d.ts,js}
sdk/svelte/dist/src/utils.{d.ts,js}
sdk/svelte/dist/svelte/src/index.{d.ts,js}

These are TypeScript build artifacts and should never be in the repo.

Fix:

git rm -r --cached sdk/svelte/dist
echo "dist/" >> sdk/svelte/.gitignore
git add sdk/svelte/.gitignore
git commit -m "chore(sdk/svelte): gitignore dist build output"

2. Verify the React hook still works

The refactor moves ~1000 lines from useInvisibleWallet.ts into a new InvisibleWalletCore class. The React hook is in production at https://veil-ezry.vercel.app — any regression breaks the live wallet.

Please confirm by running:

cd sdk
npm install
npm test   # must pass — exercises the hook end-to-end with mocked SDK

…and paste the green output in a PR comment.

Once both are addressed I'll merge straight away. The Svelte adapter itself looks great.

@Muhammadcodes112

Copy link
Copy Markdown
Author

Strong work on the architectural refactor — extracting InvisibleWalletCore so framework-specific adapters can share the logic is the right pattern. Two blockers before merge:

1. Compiled output is committed (must remove)

The diff includes 12 generated files under sdk/svelte/dist/:

sdk/svelte/dist/src/InvisibleWalletCore.{d.ts,js}
sdk/svelte/dist/src/__tests__/useInvisibleWallet.test.{d.ts,js}
sdk/svelte/dist/src/index.{d.ts,js}
sdk/svelte/dist/src/useInvisibleWallet.{d.ts,js}
sdk/svelte/dist/src/utils.{d.ts,js}
sdk/svelte/dist/svelte/src/index.{d.ts,js}

These are TypeScript build artifacts and should never be in the repo.

Fix:

git rm -r --cached sdk/svelte/dist
echo "dist/" >> sdk/svelte/.gitignore
git add sdk/svelte/.gitignore
git commit -m "chore(sdk/svelte): gitignore dist build output"

2. Verify the React hook still works

The refactor moves ~1000 lines from useInvisibleWallet.ts into a new InvisibleWalletCore class. The React hook is in production at https://veil-ezry.vercel.app — any regression breaks the live wallet.

Please confirm by running:

cd sdk
npm install
npm test   # must pass — exercises the hook end-to-end with mocked SDK

…and paste the green output in a PR comment.

Once both are addressed I'll merge straight away. The Svelte adapter itself looks great.

Alright I'll do so right away

Muhammadcodes112 and others added 2 commits May 29, 2026 03:07
@gitguardian

gitguardian Bot commented May 29, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
33210559 Triggered Generic Password 03f3904 examples/nextjs/src/lib/network.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Muhammadcodes112

Copy link
Copy Markdown
Author

Changes implemented sir, Pls Review

@Miracle656

Copy link
Copy Markdown
Owner

Following up: the recent activity here is merges from main, which keeps the branch current but doesn't yet address the earlier change request. The key item still stands — this PR adds sdk/src/InvisibleWalletCore.ts, a parallel reimplementation of the wallet core (including the signing path). Same note as on the Vue adapter (#273): the framework adapter should consume a single shared core rather than fork it, so the signing/__check_auth logic stays single-sourced. If you'd like, the core extraction can be its own focused PR (factoring useInvisibleWallet into a shared core that both React and Svelte import) and then this adapter just wraps it. Happy to review that. Thanks!

@Miracle656

Copy link
Copy Markdown
Owner

Friendly nudge — same note as the Vue adapter: #315 landed the React adapter using a shared VeilProvider/useVeilContext over the single useInvisibleWallet core (sdk/react/). Please rework the Svelte adapter to consume that shared core instead of duplicating the signing logic.

If you're still up for it, please rebase on the latest main and address the review by 2026-07-01 — otherwise I'll close this to keep the queue tidy (you can always reopen). Thanks for contributing! 🙏

- Add send method to InvisibleWalletCore for shared transfer logic
- Refactor Svelte adapter to delegate to core.send() instead of duplicating signing logic
- Export InvisibleWalletCore from main SDK entry point
- Update README documentation to reflect Svelte adapter architecture

Addresses review feedback to consume shared core instead of duplicating signing logic.
@Muhammadcodes112

Copy link
Copy Markdown
Author

Friendly nudge — same note as the Vue adapter: #315 landed the React adapter using a shared VeilProvider/useVeilContext over the single useInvisibleWallet core (sdk/react/). Please rework the Svelte adapter to consume that shared core instead of duplicating the signing logic.

If you're still up for it, please rebase on the latest main and address the review by 2026-07-01 — otherwise I'll close this to keep the queue tidy (you can always reopen). Thanks for contributing! 🙏

I'm really sorry maintainer
I totally forgot about this and thought I was done with it
I will complete it before the next 24 hrs by God grace
Thanks 🙏

@Muhammadcodes112

Copy link
Copy Markdown
Author

I have made the changes sir
Successfully commited and pushed

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the follow-up push — the sdk/svelte/dist/ build artifacts are gone and the InvisibleWalletCore refactor now reads cleanly. All GitHub Actions checks are green.

One blocker left: this branch no longer merges into main.

CONFLICT (content): Merge conflict in README.md
CONFLICT (content): Merge conflict in sdk/src/index.ts
CONFLICT (content): Merge conflict in sdk/src/useInvisibleWallet.ts

main has moved on since the two Merge branch 'main' commits on this branch. Please rebase instead of merging, so the history stays linear and the conflicts get resolved once:

git remote add upstream https://github.com/Miracle656/veil.git   # if not already
git fetch upstream main
git rebase upstream/main
# resolve README.md, sdk/src/index.ts, sdk/src/useInvisibleWallet.ts
git push --force-with-lease

When resolving sdk/src/index.ts and sdk/src/useInvisibleWallet.ts, keep the exports that are on main and add your new InvisibleWalletCore export — don't drop either side.

After the rebase, please also confirm the React hook is unregressed (this is what's live at https://veil-ezry.vercel.app):

cd sdk && npm install && npm test

Two notes that are not blockers, just FYI:

  • The three Vercel – … check failures say "Authorization required to deploy" — that's a fork-permission thing on our side, not your code.
  • GitGuardian is red; I looked through the diff and found no real credentials (only feePayerSecret variable names in the SvelteKit example), so I'm treating it as a false positive.

Ping me once the rebase is pushed and I'll merge.

@Muhammadcodes112

Copy link
Copy Markdown
Author

Thanks for the follow-up push — the sdk/svelte/dist/ build artifacts are gone and the InvisibleWalletCore refactor now reads cleanly. All GitHub Actions checks are green.

One blocker left: this branch no longer merges into main.

CONFLICT (content): Merge conflict in README.md
CONFLICT (content): Merge conflict in sdk/src/index.ts
CONFLICT (content): Merge conflict in sdk/src/useInvisibleWallet.ts

main has moved on since the two Merge branch 'main' commits on this branch. Please rebase instead of merging, so the history stays linear and the conflicts get resolved once:

git remote add upstream https://github.com/Miracle656/veil.git   # if not already
git fetch upstream main
git rebase upstream/main
# resolve README.md, sdk/src/index.ts, sdk/src/useInvisibleWallet.ts
git push --force-with-lease

When resolving sdk/src/index.ts and sdk/src/useInvisibleWallet.ts, keep the exports that are on main and add your new InvisibleWalletCore export — don't drop either side.

After the rebase, please also confirm the React hook is unregressed (this is what's live at https://veil-ezry.vercel.app):

cd sdk && npm install && npm test

Two notes that are not blockers, just FYI:

  • The three Vercel – … check failures say "Authorization required to deploy" — that's a fork-permission thing on our side, not your code.
  • GitGuardian is red; I looked through the diff and found no real credentials (only feePayerSecret variable names in the SvelteKit example), so I'm treating it as a false positive.

Ping me once the rebase is pushed and I'll merge.

Alright mate
On it
Thanks for been patient with me

@Miracle656

Copy link
Copy Markdown
Owner

Thanks for the work here. Closing this one in favour of your own newer PR #555, which targets the same issue (#174) with a much cleaner diff.

Reasons this branch can't be merged as-is:

1. Merge conflicts — the branch is CONFLICTING / DIRTY against main.

2. Out-of-scope damage to the root README.md (+52 / -283). Issue #174 is scoped to sdk/svelte/ and examples/sveltekit/, but this PR rewrites the top-level README and breaks it:

  • deletes the # Veil H1 title
  • deletes the opening and closing ``` fences around the register/__check_auth flow diagram and the project-structure tree, so the raw text now renders as prose
  • deletes the ## Project structure heading
  • deletes the ADR links to docs/adr/0001-two-account-model.md and docs/adr/0002-webauthn-signature-verification.md
  • strips the per-file descriptions under sdk/src/

3. GitGuardian: 1 secret uncovered! across the 5 commits on this branch. This is a hard merge blocker — see the note on #555, which reports the same finding.

4. Large unrelated refactor — moving 855 lines out of useInvisibleWallet.ts into a new 1209-line InvisibleWalletCore.ts is a substantial change to the React path that isn't part of #174 and should be its own PR if we want it.

5. Committed lockfilesexamples/sveltekit/pnpm-lock.yaml (1374 lines) and sdk/svelte/package-lock.json (962 lines) for an example app.

#555 avoids all of 1, 2, 4 and 5: its README change is purely additive (+22/-0), it adds no lockfiles, and it's MERGEABLE. Review will continue there. The GitGuardian finding still needs clearing on that PR before anything can merge.

@Miracle656 Miracle656 closed this Jul 30, 2026
@Muhammadcodes112
Muhammadcodes112 deleted the feat/sdk-svelte-adapter branch July 30, 2026 09:16
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.

Add Svelte adapter for invisible-wallet-sdk

2 participants