Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Feb 6, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

Minor Changes

  • #6194 9663079 Thanks @joaquim-verges! - Added session keys to smart wallet options

    You can now pass a sessionKey to the smartWallet options function to immediately add a session key to the smart wallet upon connection.

    This is great in combination with an engine backend wallet! Let's you act on behalf of the user from your backend, making executing transactions as easy as a REST API call. Also unblocks automations, like renewing a subscription, or paying for a service.

    const wallet = smartWallet({
      sessionKey: {
        address: "0x...", // the session key address (ex: engine backend wallet)
        permissions: {
          approvedTargets: ["0x..."], // allowed contract addresses (or * for all)
          nativeTokenLimitPerTransaction: 0.1, // max spend per transaction in ETH
          permissionEndTimestamp: new Date(Date.now() + 1000 * 60 * 60), // expiration date
        },
      },
    });
    
    // this will connect the user wallet and add the session key if not already added
    await wallet.connect({
      client: TEST_CLIENT,
      personalAccount,
    });

    You can also pass the sessionKey to the ConnectButton, ConnectEmbed components and useConnect hook.

    <ConnectButton
      client={client}
      accountAbstraction={{
        chain,
        sponsorGas: true,
        sessionKey: {
          address: "0x...",
          permissions: {
            approvedTargets: "*",
          },
        },
      }}
    />

    Also works for the inAppWallet smartAccount option!

    const wallet = inAppWallet({
      smartAccount: {
        chain,
        sponsorGas: true,
        sessionKey: {
          address: "0x...",
          permissions: {
            approvedTargets: "*",
          },
        },
      },
    });

Patch Changes

@thirdweb-dev/[email protected]

Patch Changes

@thirdweb-dev/[email protected]

[email protected]

Patch Changes


PR-Codex overview

This PR focuses on updating package versions and changelogs across multiple thirdweb packages, along with the introduction of new features related to session keys in smart wallets.

Detailed summary

  • Updated version in apps/login/package.json from 0.1.2 to 0.1.3.
  • Updated version in packages/thirdweb/package.json from 5.87.4 to 5.88.0.
  • Updated version in packages/service-utils/package.json from 0.8.5 to 0.8.6.
  • Updated version in packages/wagmi-adapter/package.json from 0.2.13 to 0.2.14.
  • Added changelog entries for service-utils version 0.8.6 and login version 0.1.3.
  • Introduced session keys feature in thirdweb with examples for smartWallet, ConnectButton, and inAppWallet.

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

@joaquim-verges joaquim-verges requested a review from a team as a code owner February 6, 2025 09:40
@vercel
Copy link

vercel bot commented Feb 6, 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 Feb 7, 2025 8:08pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 8:08pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 8:08pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 8:08pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 7, 2025 8:08pm


### Patch Changes

- [#6183](https://github.com/thirdweb-dev/js/pull/6183) [`18f0e57`](https://github.com/thirdweb-dev/js/commit/18f0e575c4a9764b3192931451cbd3f632a21e3c) Thanks [@arcoraven](https://github.com/arcoraven)! - [service-utils] Update list of usageV2 sources"
Copy link
Contributor

Choose a reason for hiding this comment

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

There appears to be an extra quotation mark at the end of the changelog message. The message should be [service-utils] Update list of usageV2 sources to maintain consistency with the formatting of other changelog entries.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 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.

@codecov
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.77%. Comparing base (9663079) to head (497f31f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6184      +/-   ##
==========================================
+ Coverage   56.76%   56.77%   +0.01%     
==========================================
  Files        1161     1161              
  Lines       64259    64259              
  Branches     5195     5202       +7     
==========================================
+ Hits        36478    36485       +7     
+ Misses      27052    27045       -7     
  Partials      729      729              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 9663079
packages 54.96% <ø> (+0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

see 2 files with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.21 KB (0%) 925 ms (0%) 3.5 s (+25.31% 🔺) 4.4 s
thirdweb (cjs) 121.82 KB (0%) 2.5 s (0%) 6.7 s (+4.52% 🔺) 9.1 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 292 ms (+18.38% 🔺) 403 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 51 ms (-58.04% 🔽) 61 ms
thirdweb/react (minimal + tree-shaking) 19.3 KB (0%) 386 ms (0%) 829 ms (+54.43% 🔺) 1.3 s


You can now pass a `sessionKey` to the `smartWallet` options function to immediately add a session key to the smart wallet upon connection.

This is great in combination with an engine backend wallet! Let's you act on behalf of the user from your backend, making executing transactions as easy as a REST API call. Also unblocks automations, like renewing a subscription, or paying for a service.
Copy link
Contributor

Choose a reason for hiding this comment

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

Grammar fix: Let's should be Lets since this is the third person singular form of "let" (meaning "allows"), not a contraction of "let us"

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants