Files
js/packages/wallets/CHANGELOG.md
T
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
1b052d63e9 Version Packages (#2409)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-06 15:23:29 -08:00

116 KiB

@thirdweb-dev/wallets

2.4.15

Patch Changes

2.4.14

Patch Changes

2.4.13

Patch Changes

2.4.12

Patch Changes

2.4.11

Patch Changes

2.4.10

Patch Changes

2.4.9

Patch Changes

2.4.8

Patch Changes

2.4.7

Patch Changes

2.4.6

Patch Changes

2.4.5

Patch Changes

2.4.4

Patch Changes

2.4.3

Patch Changes

2.4.2

Patch Changes

2.4.1

Patch Changes

2.4.0

Minor Changes

  • #2098 22571ba0 Thanks @joaquim-verges! - - Add options to override gasless per transaction
    • Better userOp estimations
    • Performance optimisations

Patch Changes

2.3.4

Patch Changes

2.3.3

Patch Changes

2.3.2

Patch Changes

2.3.1

Patch Changes

2.3.0

Minor Changes

  • #2018 33c9f6b1 Thanks @iketw! - Enforces passing an encryption key for custom jwt auth

    const embedded = useEmbeddedWallet();
    
    embedded.connect({
      jwt: "<token>",
      encryptionKey: "<my-key>",
      strategy: "jwt",
    });
    

Patch Changes

  • #2070 de5ebc90 Thanks @MananTank! - Fix assertWindowEthereum - actually check if window.ethereum is truthy or not instead of just checking "ethereum" in window

  • #2080 e10173bf Thanks @adam-maj! - Add support for signTransaction to smart wallets

  • #2077 09bafa9a Thanks @joaquim-verges! - Respect value in smart wallet gas estimations + add getUserOpReceipt utility function

2.2.1

Patch Changes

2.2.0

Minor Changes

  • #2052 94966069 Thanks @ElasticBottle! - feat: add custom auth endpoint authentication strategy support for embeddedWallet

    Configure the endpoint for where the payload is to be sent too over at thirdweb.com/dashboard.

    await embeddedWallet.authenticate({
        strategy: "auth_endpoint",
        payload: "SOME_STRING",
        encryptionKey: ""
    });
    

Patch Changes

2.1.11

Patch Changes

2.1.10

Patch Changes

2.1.9

Patch Changes

2.1.8

Patch Changes

2.1.7

Patch Changes

2.1.6

Patch Changes

2.1.5

Patch Changes

2.1.4

Patch Changes

2.1.3

Patch Changes

2.1.2

Patch Changes

  • #1937 3f3a484a Thanks @joaquim-verges! - Remove deprecated fallback for old account factories

  • #1920 a81a5285 Thanks @ElasticBottle! - feat: add apple auth to embedded wallet.

    To enable simply pass in apple as the strategy

    const wallet = new EmbeddedWallet({
      chain: Ethereum, //  chain to connect to
      clientId: "YOUR_CLIENT_ID", // client ID
    });
    
    const authResult = await wallet.authenticate({
      strategy: "apple",
    });
    
    
  • #1943 30ea9c6b Thanks @iketw! - Adds tsdoc warnings to enforce a common comments format

  • #1925 97fdbc8f Thanks @iketw! - [RN] Adds walletConnectReceiver prop to EmbeddedWallet and SmartWallet

    You can pass your own WalletConnect projectId and metadata (highly recommended):

    embeddedWallet({
        auth: {
        options: ['email', 'google'],
        redirectUrl: 'redirect-url',
        },
        walletConnectReceiver: {
            walletConnectWalletMetadata?: WCMetadata;
            walletConnectV2ProjectId?: string;
            walletConnectV2RelayUrl?: string;
        },
    }),
    
    smartWallet(localWallet(), {
        factoryAddress: 'factory-address',
        gasless: true,
        walletConnectReceiver: {
            walletConnectWalletMetadata?: WCMetadata;
            walletConnectV2ProjectId?: string;
            walletConnectV2RelayUrl?: string;
        },
    }),
    

    You can just pass true to the prop and these props will default to our internal WalletConnect projectId and metadata.

    embeddedWallet({
        auth: {
        options: ['email', 'google'],
        redirectUrl: 'redirect-url',
        },
        walletConnectReceiver: true
    }),
    
    smartWallet(localWallet(), {
        factoryAddress: 'factory-address',
        gasless: true,
        walletConnectReceiver: true
    }),
    
  • Updated dependencies [3f3a484a]:

2.1.1

Patch Changes

2.1.0

Minor Changes

  • #1846 0acc530f Thanks @joaquim-verges! - # New Embedded Wallet API:

    Headless Email authentication

    // send verification email
    await embeddedWallet.sendVerificationEmail({
      email,
    });
    
    // verify email
    const authResult = embeddedWallet.authenticate({
      strategy: "email_verification",
      verificationCode: code,
    });
    
    // connect
    const walletAddress = embeddedWallet.connect({
      authResult,
    });
    

    Google sign in authentication

    // prompt google sign in
    const authResult = embeddedWallet.authenticate({
      strategy: "google",
    });
    
    // connect
    const walletAddress = embeddedWallet.connect({
      authResult,
    });
    

    iframe based authentication

    // open iframe to sign in
    const authResult = embeddedWallet.authenticate({
      strategy: "iframe",
    });
    
    // connect
    const walletAddress = embeddedWallet.connect({
      authResult,
    });
    

    Custom Auth (JWT)

    // authenticate with any JWT system
    const jwt = await yourLogin();
    
    // verify JWT
    const authResult = embeddedWallet.authenticate({
      strategy: "jwt",
      jwt,
    });
    
    // connect
    const walletAddress = embeddedWallet.connect({
      authResult,
    });
    

Patch Changes

2.0.10

Patch Changes

2.0.9

Patch Changes

2.0.8

Patch Changes

2.0.7

Patch Changes

2.0.6

Patch Changes

2.0.5

Patch Changes

2.0.4

Patch Changes

2.0.3

Patch Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

  • #1742 e684d05e Thanks @MananTank! - Fix RPCs not updated in given chain object when clientId is passed to the EmbeddedWallet, PaperWallet, SmartWallet, BloctoWallet, SignerWallet constructors.

2.0.0

Major Changes

  • #1630 ce4608bf Thanks @jnsdls! - Dropped Support for Solana:

    • We've decided to drop support for Solana across our SDKs.
    • Starting with this version of our SDKs all previous solana related functionality will be removed.
    • Previous versions of our SDKs will continue to work with Solana. However, we will not be providing any further updates or bug fixes for Solana.
    • You can read a detailed explanation of our decision on our blog.
  • #1630 ce4608bf Thanks @jnsdls! - Dropped Support for Node 16:

    • As part of our commitment to maintain up-to-date with the evolving ecosystem and provide the best support for our users, we have made the decision to cease support for Node 16. Starting with this version, our SDKs will no longer be tested against or guaranteed to work with Node.js version 16.
    • We encourage users to upgrade to a more recent version of Node.js to continue to benefit from the latest features, improvements, and security updates.
    • If you are unable to upgrade to a more recent version of Node.js, you can continue to use the previous version of our SDKs. However, we will not be providing any further updates or bug fixes for Node 16.
    • For more information on EOL status of Node 16, see Node.js Release Cycle.

Patch Changes

1.3.5

Patch Changes

1.3.4

Patch Changes

  • #1712 9bd01de5 Thanks @joaquim-verges! - New SmartWallet API for session keys

    You can now add admins and scoped session keys to smart wallets directly with a simple API:

    const smartWallet = new SmartWallet(config);
    await smartWallet.connect({ personalWallet })
    
    await smartWallet.createSessionKey(keyAddress, permissions);
    await smartWallet.revokeSessionKey(keyAddress);
    
    await smartWallet.addAdmin(adminAddress);
    await smartWallet.removeAdmin(adminAddress);
    
  • Updated dependencies [f35fbec1]:

1.3.3

Patch Changes

1.3.2

Patch Changes

1.3.1

Patch Changes

1.3.0

Minor Changes

  • #1598 43f188c8 Thanks @ElasticBottle! - feat(wallets): Add EmbeddedWallet and EmbeddedWalletConnector to @thirdweb-dev/wallets for use in vanilla JS clients

Patch Changes

1.2.1

Patch Changes

1.2.0

Minor Changes

  • #1563 defe5fce Thanks @ElasticBottle! - feat(wallets): Adds ThirdwebEmbeddedWalletSdk that allows user to have a MPC EOA wallet spun up for them seamlessly

Patch Changes

1.1.23

Patch Changes

1.1.22

Patch Changes

1.1.21

Patch Changes

1.1.20

Patch Changes

1.1.19

Patch Changes

1.1.18

Patch Changes

1.1.17

Patch Changes

1.1.16

Patch Changes

1.1.15

Patch Changes

1.1.14

Patch Changes

1.1.13

Patch Changes

1.1.12

Patch Changes

1.1.11

Patch Changes

1.1.10

Patch Changes

1.1.9

Patch Changes

1.1.8

Patch Changes

1.1.7

Patch Changes

1.1.6

Patch Changes

  • #1421 fbde927a Thanks @iketw! - Add private methods transform plugin to the wallets package for ReactNative support

1.1.5

Patch Changes

1.1.4

Patch Changes

1.1.3

Patch Changes

1.1.2

Patch Changes

1.1.1

Patch Changes

1.1.0

Minor Changes

  • #1316 d8447146 Thanks @iketw! - 1. Adds new clientId / secretKey option to access thirdweb's services

    You can create a free clientId / secretKey pair on the thirdweb Dashboard

    // For wallets used on the client-side (i.e. react, react-native) you should
    // pass a `clientId`
    const metamaskWallet = new MetaMaskWallet({
      clientId: "your-client-id",
    });
    
    // For wallets used on the backend-side (i.e. node, express) you should
    // pass a `secretKey`
    const localWallet = new LocalWallet({
      secretKey: "your-secret-key",
    });
    
    1. Paper wallet's clientId is renamed to paperClientId.

    The clientId option is reserved for thirdweb's `clientId``

    const paperWallet = new PaperWallet({
      clientId: "your-thirdweb-client-id",
      paperClientId: "your-paper-client-id",
    });
    

Patch Changes

1.0.12

Patch Changes

1.0.11

Patch Changes

1.0.10

Patch Changes

1.0.9

Patch Changes

1.0.8

Patch Changes

1.0.7

Patch Changes

1.0.6

Patch Changes

1.0.5

Patch Changes

1.0.4

Patch Changes

1.0.3

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

  • #1259 efb3546e Thanks @iketw! - Fix. Respecting passed wallets if less then 50, otherwhise use defaults chains.

1.0.0

Major Changes

Patch Changes

0.3.3

Patch Changes

  • #1237 536b0f12 Thanks @iketw! - [React] Add Rainbow Wallet (implementing the WalletConnect wallet)

    import { ThirdwebProvider, rainbowWallet } from "@thirdweb-dev/react";
    
    const activeChain = "ethereum";
    
    <ThirdwebProvider
      activeChain={activeChain}
      supportedWallets={[rainbowWallet()]}
    >
      <App />
    </ThirdwebProvider>;
    
  • #1236 b626782b Thanks @iketw! - [Wallets/React] Add Trust Wallet

    import { ThirdwebProvider, trustWallet } from "@thirdweb-dev/react";
    
    const activeChain = "mumbai";
    
    <ThirdwebProvider
      activeChain={activeChain}
      autoSwitch={true}
      supportedWallets={[trustWallet()]}
    >
      <App />
    </ThirdwebProvider>;
    
  • Updated dependencies [d498c79a, 9af346ee]:

0.3.2

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

Patch Changes

0.2.26

Patch Changes

0.2.25

Patch Changes

0.2.24

Patch Changes

0.2.23

Patch Changes

  • #1010 bba9767a Thanks @iketw! - [ReactNative-Wallets] Enables SmartWallet to connect to an app, with implementation in React Native

    • Wallets package
    1. Smart Wallet now supports connecting an external app to it. It acts as an actual wallet implementing the WC protocol
    2. There are two WalletConnect handlers to manage V1 and V2 WC connections
    3. Creates a synchronous storage interface used in WCV1
    4. To have your connector support WC, you need to implement the interface: IWalletConnectReceiver.
    5. You can now pass the flag enableConnectApp to the smart wallet config to enable a new field in our modal to connect an app to your smart wallet
    smartWallet({
        factoryAddress: "..."
        thirdwebApiKey: "apiKey"
        gasless: true,
        personalWallets: [localWallet()],
        enableConnectApp: true,
    }),
    
    • React Native
    1. Creates new modals for WC SessionRequests and SessionApprovals
    2. Implements SyncStorage using MMKV
  • #1065 bd86661f Thanks @iketw! - [ReactNative] Add support for signing in with email/phone using magic sdk

    Devs can now add a new supportedWallet:

    import { Goerli } from '@thirdweb-dev/chains';
    import { ThirdwebProvider, magicWallet } from '@thirdweb-dev/react-native';
    
    <ThirdwebProvider
        activeChain={Goerli}
        supportedWallets={[
        magicWallet({
            apiKey: 'magic_api_key',
        }),
    ]}>
    
  • #1070 68fa1896 Thanks @joaquim-verges! - Expose smartWallet.deploy() and smartWallet.isDeployed()

  • #1085 292a321a Thanks @MananTank! - Fix Metamask disconnection on switch chain

  • #1073 f3b2ae3f Thanks @ciaranightingale! - Update Smart Wallet "getAddress" with "data" arg

  • #1088 4f99ccb4 Thanks @iketw! - [RN/Wallets] Adds send_transaction support for wcv1 Connect to App feature

  • #1064 c85810ee Thanks @MananTank! - Do not cache signer in wallets

  • #1087 35984362 Thanks @adam-maj! - Add proper on-chain signing for Safe

  • Updated dependencies [2f1df0b5, 189daf02, afae0873, c6e74ef0, ee4c7de2, f7b352a5, 4a1d7581, bdabbef7, 59206233, 98efd090, 8eecf4c2, bd86661f, d5651006, da576108, c85810ee, 6fd10f94, 5f1e6abb, a034b032]:

0.2.22

Patch Changes

0.2.21

Patch Changes

0.2.20

Patch Changes

0.2.19

Patch Changes

0.2.18

Patch Changes

  • #973 93bdec06 Thanks @MananTank! - - Fix PaperWallet.connect() error

    • Fix return type of Wallet.autoConnect()
  • #981 ea0f9479 Thanks @iketw! - ## [ReactNative] Allow custom wallets be added to the ConnectWallet button modal

    With this new API you can build your own wallet and wallet UI and integrate it into our ConnectWallet modal:

    import type { ConfiguredWallet, ConnectUIProps } from '@thirdweb-dev/react-native';
    import { createAsyncLocalStorage, ConnectUIProps } from '@thirdweb-dev/react-native';
    import { WalletOptions } from '@thirdweb-dev/wallets';
    
    const WALLET_ID = "my-wallet-id";
    
    export const myWallet = (): ConfiguredWallet => {
      const asyncStorage = createAsyncLocalStorage(WALLET_ID);
      const configuredWallet = {
        id: WALLET_ID,
        meta: {
            id: WALLET_ID,
            name: "My Custom Wallet", // This will be displayed in the connect wallet modal
            iconURL: "ipfs or https url to an image or svg" // This will be used to fetch the icon to show in the connect wallet modal
        },
        create: (options: WalletOptions) =>
          new MyWallet({
            ...options,
            walletStorage: asyncStorage,
          }),
        connectUI(props: ConnectUIProps) {
          return <MyWalletUI {...props} />; // This will show up in the modal after the user selects your wallet
        },
      };
    
      return configuredWallet;
    };
    

    You can then add the wallet to your supportedWallets in the ThirdwebProvider:

    import { Goerli } from '@thirdweb-dev/chains';
    import {
      ThirdwebProvider,
      metamaskWallet,
    } from '@thirdweb-dev/react-native';
    
    const activeChain = Goerli;
    
    const App = () => {
      return (
        <ThirdwebProvider
          activeChain={activeChain}
          supportedChains={[activeChain]}
          supportedWallets={[
            myWallet(),
            metamaskWallet(),
          ]}>
          <AppInner />
        </ThirdwebProvider>
      );
    };
    

    This new version exposes some utility functions:

    1. formatWalletConnectDisplayUri

    Formats the wallet connect wc:// url for usage with custom wallet links

    1. shortenWalletAddress

    Shortens a wallet address for display purposes

    1. createAsyncLocalStorage and createSecureStorage

    You can use these methods to get wallet compatible storage types.

    • createAsyncLocalStorage uses MMKV in the background
    • createSecureStorage uses Expo SecureStore in the background
  • #978 05ebbc15 Thanks @joaquim-verges! - Export ethers and private key wallets top level

  • #974 4ca557ae Thanks @iketw! - [Wallet] Rename Connector to WagmiConnector and TWConnector to Connector

  • #967 7d7685e3 Thanks @MananTank! - - Fix type of connect() for magic wallet

    • enforce smsLogin, emailLogin restriction for magic wallet
    • update the icon for local wallet
  • #977 93bd5733 Thanks @MananTank! - Fix Connect Wallet Open/Close issues

  • Updated dependencies [5305b42d, eb521d24, af4b5356, 93bd5733, a2df187b, aa9b6acc]:

0.2.17

Patch Changes

0.2.16

Patch Changes

0.2.15

Patch Changes

  • #868 b616dca7 Thanks @iketw! - - Updates base wallet classes names

    • Makes InjectedWallet params optional
    • Removes connector storage constructor param from Injected and MetaMask wallets
  • #872 2545a440 Thanks @nachoiacovino! - Rename Wallet Connect to WalletConnect

  • #859 229a4741 Thanks @MananTank! - Fix Error when connecting to Safe in Vite

0.2.14

Patch Changes

0.2.13

Patch Changes

  • #851 c5c2d947 Thanks @MananTank! - Fix wallet autoconnect issues

    Fixes

    • infinite loading spinner on connect wallet button when wallet is locked or connection to app is closed
    • network switch popup on page load when wallet is connected to different network than it was previously connected
    • removed autoconnect timeout - don't need it anymore
  • #855 2dd192a5 Thanks @MananTank! - Add auth in Connect Wallet button

0.2.12

Patch Changes

0.2.11

Patch Changes

0.2.10

Patch Changes

0.2.9

Patch Changes

  • #584 d01b135d Thanks @MananTank! - [Wallets, RN, React, ReactCore] New Wallets SDK implementation

    Breaking changes:

    React and React Native

    1. Replaced walletConnectors with supportedWallets in the ThirdwebProvider.
      import { coinbaseWallet, metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      - return <ThirdwebProvider walletConnectors={["metamask", "coinbaseWallet"]}>{...}</ThirdwebProvider>
      + return <ThirdwebProvider supportedWallets={[metamaskWallet(), coinbaseWallet()]}>{...}</ThirdwebProvider>
      }
    
    1. magicLinkConnector not yet implemented in this version

    2. Removed desiredChainId, use activeChain instead

    3. DAppMetaData type now requires the url field to be passed in

    4. Removed chainRpc prop from the ThirdwebProvider. You can pass custom rpcs in the Chain object through the activeChain and supportedChains props.

    5. Replaced the useNetwork hook for useChain and useSwitchChain

    6. Updated ConnectWallet button in React:

    • Removed accentColor and colorMode
    • Added a theme prop with dark and light values
    1. Updated the Web3Button button in React:
    • Removed accentColor and colorMode
    • Added a theme prop with dark and light values

    Patch Changes

    • You can now pass a theme prop to the ThirdwebProvider. Values are light and dark
      import { ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      return <ThirdwebProvider theme='light'>{...}</ThirdwebProvider>
      }
    
    • New wallet hooks added

      • useWallet()
      • useConenct()
      • useConnectionStatus()
      • useSwitchChain()
    • Removed wagmi dependency from the react-native-compat package and updated shims

    • New ConnectWallet and Web3Button components in React Native

    • New wallets package with support for the most common wallets. MetaMask, Coinbase, WalletConnect V1 and V2 and PaperWallet

    • Added autoSwitch prop to the ThirdwebProvider to control whether or not to automatically switch to wallet's network to active chain

      import { ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      return <ThirdwebProvider autoSwitch>{...}</ThirdwebProvider>
      }
    
  • #760 93eca1de Thanks @jnsdls! - keep @coinbase/wallet-sdk as a full dependency instead of peer dependency

  • #794 a6fce0f6 Thanks @shift4id! - Minor copy changes

  • #825 4bdeefe6 Thanks @iketw! - [Core,React,RN,Wallets] Allow for wallets to be created without props where possible

    You can now create wallets without having to worry about it's params. We provide sensible defaults.

    const w = new WalletConnectV1();
      w.connect();
    
    const w1 = new WalletConnect();
    w1.connect();
    
    const cb = new CoinbaseWallet()
    w1.connect();
    
    const safe = new SafeWallet();
    
    const device = new DeviceBrowserWallet();
    
  • #702 33d1cc7f Thanks @jnsdls! - enable browser export

  • #833 83e99dbf Thanks @MananTank! - Fix paper wallet autoconnect issue

  • #824 95bcfa6d Thanks @iketw! - [Wallets] Add autoconnect capabilities

    • You can now call .autoConnect on your wallets and it will check if the wallet is connected. If it's not, it will not trigger the connect flow
  • #802 4d07b4b4 Thanks @iketw! - [ReactCore/Wallets] ReactCore manages all coordination for wallet reconnection

  • #739 4d5fdda9 Thanks @jnsdls! - Add Safe connector and wallet

  • #835 6b31a9bc Thanks @iketw! - [Wallets] set qrcode prop correctly

  • #764 4b77bc9b Thanks @MananTank! - paper wallet, do not save device wallet password

  • #584 d01b135d Thanks @MananTank! - [Wallets] New and updated wallets. [RN] UI Components and Wallets support.

  • #832 e47ceafe Thanks @MananTank! - - Fix wallet.addListener "connect", "disconnect" event emit issue

    • update the paper sdk
  • #778 6c0c6538 Thanks @joaquim-verges! - Device wallet input cleanup

  • #786 ddc1c33a Thanks @MananTank! - Gnosis Safe

  • #748 2221f97d Thanks @MananTank! - [ReactCore] Inject api key to chains

  • Updated dependencies [d01b135d, e3161e59, 33d1cc7f, 6b145d4b, e2ec70c4, 1baed0b1, 2221f97d, 5c7c0923, 9a4a542c, b2d0ffb0]:

0.2.8

Patch Changes

0.2.7

Patch Changes

0.2.6

0.2.5

0.2.4

0.2.3

Patch Changes

0.2.2

0.2.1

Patch Changes

0.2.0

Minor Changes

  • #460 a6c074c Thanks @adam-maj! - Wallets abstraction along with major Auth upgrade. Wallets split into EVM and Solana entrypoints along with GenericAuthWallet implementation.

    Additionally, AWSKmsWallet and AWSSecretsManager wallets have been moved into the @thirdweb-dev/wallets/evm entrypoint from the SDK.

0.1.1

Patch Changes

0.1.0

Minor Changes