Skip to content

Releases: thirdweb-dev/js

thirdweb@5.88.0

08 Feb 00:15
a322e16
Compare
Choose a tag to compare

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/wagmi-adapter@0.2.15

08 Feb 04:11
fecd3a6
Compare
Choose a tag to compare
@thirdweb-dev/wagmi-adapter@0.2.15

@thirdweb-dev/wagmi-adapter@0.2.14

08 Feb 00:14
a322e16
Compare
Choose a tag to compare
@thirdweb-dev/wagmi-adapter@0.2.14

@thirdweb-dev/service-utils@0.8.7

08 Feb 04:11
fecd3a6
Compare
Choose a tag to compare

Patch Changes

@thirdweb-dev/service-utils@0.8.6

08 Feb 00:15
a322e16
Compare
Choose a tag to compare

Patch Changes

thirdweb@5.87.4

06 Feb 08:51
e732b11
Compare
Choose a tag to compare

Patch Changes

@thirdweb-dev/wagmi-adapter@0.2.13

06 Feb 08:51
e732b11
Compare
Choose a tag to compare
@thirdweb-dev/wagmi-adapter@0.2.13

@thirdweb-dev/service-utils@0.8.5

06 Feb 08:51
e732b11
Compare
Choose a tag to compare

Patch Changes

thirdweb@5.87.3

04 Feb 06:45
ca6c913
Compare
Choose a tag to compare

Patch Changes

@thirdweb-dev/wagmi-adapter@0.2.12

04 Feb 06:45
ca6c913
Compare
Choose a tag to compare
@thirdweb-dev/wagmi-adapter@0.2.12