Skip to content

[SDK]: add backend wallets for in app wallet #5878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ElasticBottle
Copy link
Contributor

@ElasticBottle ElasticBottle commented Jan 3, 2025


title: "[SDK] Feature: add backend wallets for in app wallet"

https://linear.app/thirdweb/issue/TOOL-2884/backend-server-wallets

Notes for the reviewer

This also fixes the cache mechanics for thirdweb clients to include a partial string of the secret key. Was running into an issue where the client was originall instantiated without the secret key and even when a new client with secret key was passed in, we keep falling back to the cached client without secret key

How to test

Add a button on playground with a client that has secret key and create a new backend wallet.


PR-Codex overview

This PR introduces support for backend wallet authentication in the thirdweb library, allowing applications to authenticate users via a backend account without managing private keys.

Detailed summary

  • Added backend strategy for wallet authentication.
  • Updated authenticate function to support backend authentication.
  • Modified InAppWebConnector and InAppNativeConnector to handle backend authentication.
  • Implemented backendAuthenticate function for server-side authentication.
  • Updated documentation to include examples for backend authentication.
  • Added tests for backendAuthenticate and related functionality.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@ElasticBottle ElasticBottle requested review from a team as code owners January 3, 2025 10:33
Copy link

linear bot commented Jan 3, 2025

Copy link

changeset-bot bot commented Jan 3, 2025

🦋 Changeset detected

Latest commit: 70b7b5c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
thirdweb Minor
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 3:32am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 3:32am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 3:32am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2025 3:32am

Copy link
Contributor

graphite-app bot commented Jan 3, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@ElasticBottle ElasticBottle changed the title [SDK]: add backend wallets for ecosystem and in app wallet [SDK]: add backend wallets for in app wallet Jan 3, 2025
Copy link
Contributor

github-actions bot commented Jan 3, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 45.64 KB (0%) 913 ms (0%) 2.4 s (-14.12% 🔽) 3.3 s
thirdweb (cjs) 115.44 KB (0%) 2.4 s (0%) 3.8 s (+2.3% 🔺) 6.1 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 282 ms (+26.77% 🔺) 393 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 74 ms (+39.92% 🔺) 84 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 451 ms (+8.1% 🔺) 834 ms

Copy link
Member

@gregfromstl gregfromstl left a comment

Choose a reason for hiding this comment

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

Just missing test coverage

Copy link
Member

gregfromstl commented Jan 7, 2025

Merge activity

  • Jan 6, 9:48 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 6, 9:48 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 6, 9:51 PM EST: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Unit Tests').
  • Jan 7, 2:44 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 7, 10:28 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 7, 10:32 PM EST: A user merged this pull request with the Graphite merge queue.

gregfromstl pushed a commit that referenced this pull request Jan 7, 2025
---
title: "[SDK] Feature: add backend wallets for  in app wallet"
---

https://linear.app/thirdweb/issue/TOOL-2884/backend-server-wallets

## Notes for the reviewer
This also fixes the cache mechanics for thirdweb clients to include a partial string of the secret key. Was running into an issue where the client was originall instantiated without the secret key and even when a new client with secret key was passed in, we keep falling back to the cached client without secret key

## How to test
Add a button on playground with a client that has secret key and create a new backend wallet.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces support for backend wallet authentication in the `thirdweb` library, allowing applications to connect to wallet accounts programmatically without managing private keys.

### Detailed summary
- Added `backend` strategy for wallet authentication.
- Updated `authenticate` functions to include backend authentication examples.
- Introduced `backendAuthenticate` function for server-side authentication.
- Modified `InAppWebConnector` and `InAppNativeConnector` to handle backend authentication.
- Enhanced type definitions to include `backend` strategy.
- Added tests for `backendAuthenticate` and its integration in connectors.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@gregfromstl gregfromstl force-pushed the winston/tool-2884-backend-server-wallets branch from 70694d1 to a21ff2c Compare January 7, 2025 02:49
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Jan 7, 2025
@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Jan 7, 2025
---
title: "[SDK] Feature: add backend wallets for  in app wallet"
---

https://linear.app/thirdweb/issue/TOOL-2884/backend-server-wallets

## Notes for the reviewer
This also fixes the cache mechanics for thirdweb clients to include a partial string of the secret key. Was running into an issue where the client was originall instantiated without the secret key and even when a new client with secret key was passed in, we keep falling back to the cached client without secret key

## How to test
Add a button on playground with a client that has secret key and create a new backend wallet.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces support for backend wallets in the `thirdweb` library, allowing applications to authenticate users with a backend strategy, enhancing security by managing wallet access without exposing private keys.

### Detailed summary
- Added `backend` strategy for wallet authentication.
- Updated `authenticate` function to support `backend` strategy.
- Introduced `backendAuthenticate` function for backend authentication.
- Updated `InAppWebConnector` and `InAppNativeConnector` to handle `backend` strategy.
- Modified type definitions to include `backend` strategy.
- Added tests for `backendAuthenticate` and its integration in connectors.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants