thirdweb@5.88.0
Minor Changes
-
#6194
9663079
Thanks @joaquim-verges! - Added session keys to smart wallet optionsYou can now pass a
sessionKey
to thesmartWallet
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 theConnectButton
,ConnectEmbed
components anduseConnect
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
-
#6193
1f6bb7c
Thanks @joaquim-verges! - Show fiat amount in PayEmbed main screen -
#6192
30e13e6
Thanks @joaquim-verges! - Allow editing pay amount mid flow -
#6190
2dfc245
Thanks @joaquim-verges! - Add fiat provider selection in PayEmbed -
#6187
ee57ded
Thanks @joaquim-verges! - Requery allowances when getting back to quote screen -
#6188
64d7bf3
Thanks @jnsdls! - when explicitly passingclientId
tocreateThirdwebClient()
prefer it over computing theclientId
from a passedsecretKey
option