Skip to content

Latest commit

 

History

History
1357 lines (842 loc) · 92.2 KB

CHANGELOG.md

File metadata and controls

1357 lines (842 loc) · 92.2 KB

@thirdweb-dev/react

3.14.1

Patch Changes

3.14.0

Minor Changes

Patch Changes

3.13.1

Patch Changes

3.13.0

Patch Changes

3.12.4

Patch Changes

3.12.3

Patch Changes

3.12.2

Patch Changes

3.12.1

Patch Changes

3.12.0

Minor Changes

  • #993 b1ede491 Thanks @0xfrosty! - Add React hook useBuyDirectListing() to buy a direct listing in a MarketplaceV3 contract

Patch Changes

  • #1001 2b0fb9d2 Thanks @MananTank! - Fix Flaky coinbase QR code scan

  • #1015 39bd9630 Thanks @MananTank! - - add selectUI api in WalletConfig to allow rendering a custom UI for selecting a wallet

    • Render an input for paper wallet and magic link using selectUI api
    • add prop modalTitle on ConnectWallet to configure a custom title for the modal
    • add props selectionData, setSelectionData and supportedWallets on connectUI
  • #996 c3645c45 Thanks @MananTank! - - add theme in ConfiguredWallet.connectUI's props - to use theme aware UI for wallets

    • add useWalletConfig hook to get the ConfiguredWallet object for active wallet
    • add hooks useSetConnectedWallet, useSetConnectionStatus
    • rename useActiveChain to useChain - keep the useActiveChain also with deprecated tag
    • make useSafe hook await-able by returning the promise of connect() call
    • add hook useSmartWallet
    • allow rendering custom wallet details button via <ConnectWallet detailsButton={} /> prop
    • Rename "Export" to "Backup" in local wallet UI
  • #1011 470e0a14 Thanks @MananTank! - rename ConfiguredWallet to WalletConfig

    - import { ConfiguredWallet } from '@thirdweb-dev/react';
    + import { WalletConfig } from '@thirdweb-dev/react';
  • #1022 738c0ec6 Thanks @mmeigooni! - Update Paper SDK version

  • #1002 d495a4b8 Thanks @MananTank! - Expose Web3Modal QRModalOptions in WalletConnect V2

  • #989 8db78299 Thanks @iketw! - [React/ReactNative] Updated useThirdwebWallet to useWalletContext

  • #998 4f843833 Thanks @MananTank! - - skip wallet-selector screen if there's a single wallet

    • Fix "Can't close Safe screen" issue
    • Fix magicSdkConfiguration type
  • Updated dependencies [e9b69300, 39bd9630, 49ec2d17, 799d98e8, c3645c45, 470e0a14, b1ede491, 738c0ec6, d495a4b8, 482f6d1b, e4356e76, 9886c858, 8db78299, 4f843833]:

3.11.11

Patch Changes

3.11.10

Patch Changes

3.11.9

Patch Changes

3.11.8

Patch Changes

3.11.7

Patch Changes

3.11.6

Patch Changes

3.11.5

Patch Changes

3.11.4

Patch Changes

3.11.3

Patch Changes

3.11.2

Patch Changes

3.11.1

Patch Changes

3.11.0

Minor 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>
      }
    

Patch Changes

3.10.3

Patch Changes

3.10.2

Patch Changes

3.10.1

Patch Changes

3.10.0

Patch Changes

3.9.5

Patch Changes

3.9.4

Patch Changes

3.9.3

Patch Changes

3.9.2

Patch Changes

3.9.1

Patch Changes

3.9.0

Minor Changes

  • af8cf40 Thanks @joaquim-verges! - ## Now supports Any EVM - Any Contract!

    • no longer requires desiredChainId to be passed to ThirdwebProvider
    • apps can now pass activeChain to ThirdwebProvider to define the chain to connect to (can be a chainId or a fully defined chain object from @thirdweb-dev/chains)
    • if no activeChain is passed but a wallet is connected the SDK will be initialized with the chain of the connected wallet
    • (advanced) apps can now define the chains they want to support by passing supportedChains to ThirdwebProvider

    Deprecated options

    • desiredChainId is now deprecated and will be removed in the next major version. Please use activeChain instead.
    • chainRPC is now deprecated and will be removed in the next major version. Please use supportedChains instead.

    Basic Setup

    import { ThirdwebProvider } from "@thirdweb-dev/react";
    - import { ChainId } from "@thirdweb-dev/sdk";
    
    const App = () => {
    - return <ThirdwebProvider desiredChainId={ChainId.Ethereum}>{...}</ThirdwebProvider>
    + return <ThirdwebProvider>{...}</ThirdwebProvider>
    }

    Use a specific chain

    import { ThirdwebProvider } from "@thirdweb-dev/react";
    
    const App = () => {
      // Polygon is a default chain, so you can pass the chain name without needing to define "supportedChains"
      return (
        <ThirdwebProvider activeChain="polygon">{/* {...} */}</ThirdwebProvider>
      );
    };

    Use a non-default chain

    import { Sepolia } from "@thirdweb-dev/chains";
    import { ThirdwebProvider } from "@thirdweb-dev/react";
    
    const App = () => {
      // since there is only one supported chain defined this will automatically default the SDK to Sepolia
      return (
        <ThirdwebProvider activeChain={Sepolia}>{/* {...} */}</ThirdwebProvider>
      );
    };

Patch Changes

3.8.2

Patch Changes

3.8.1

Patch Changes

3.8.0

Patch Changes

3.7.4

Patch Changes

3.7.3

Patch Changes

3.7.2

Patch Changes

3.7.1

Patch Changes

3.7.0

Minor Changes

  • #460 a6c074c Thanks @adam-maj! - All Auth hooks and configuration have been upgraded along with the major upgrade to Auth. This includes changes in necessary authConfig to the ThirdwebProvider, as well as usage of the useLogin, useLogout, and useUser hooks.

    How to upgrade

    In order to upgrade your frontend setup to account for these changes, you'll need to make the following changes to your app:

    1. Remove loginRedirect from authConfig

    In your ThirdwebProvider, you can remove the loginRedirect option from the authConfig object, as the login endpoint no longer uses redirects.

    export default function MyApp({ Component, pageProps }) {
      return (
        <ThirdwebProvider
          authConfig={{
            domain: "example.com",
            authUrl: "/api/auth",
            // No more loginRedirect
          }}
        >
          <Component {...pageProps} />
        </ThirdwebProvider>
      );
    }

    2. Update useLogin and useLogout to use object destructuring

    The useLogin and useLogout hooks now return an object with a login and logout function (as well as isLoading states), respectively. You'll need to update your usage of these hooks to use object destructuring.

    import { useLogin, useLogout } from "@thirdweb-dev/react";
    
    export default function Component() {
      const { login } = useLogin();
      const { logout } = useLogout();
    
      return (
        <div>
          <button onClick={login}>Login</button>
          <button onClick={logout}>Logout</button>
        </div>
      );
    }

Patch Changes

  • #514 48893c7 Thanks @jnsdls! - switch to using the new @thirdweb-dev/react-core package to power @thirdweb-dev/react

  • #493 f37e86b Thanks @joaquim-verges! - Move solana dependencies to peer dependencies, please install them separately:

    npm install @thirdweb-dev/sdk @thirdweb-dev/react @metaplex-foundation/js @project-serum/anchor @solana/wallet-adapter-wallets

  • #512 065c4db Thanks @ikethirdweb! - Updates useClaimedNFTs to only fetch claimed NFTs

  • Updated dependencies [48893c7, a6c074c, 62b7388]:

3.6.11

Patch Changes

3.6.10

3.6.9

3.6.8

Patch Changes

  • #454 c673e39 Thanks @jnsdls! - upgraded dependencies

  • #422 08d04fe Thanks @yehia67! - Add btnTitle prop to the ConnectWallet component. Now you can set customized string or child component to the connect button.

3.6.7

Patch Changes

  • #448 7a37e56 Thanks @jnsdls! - [EVM] - allow useContract to fail faster to enable the import case

3.6.6

Patch Changes

3.6.5

3.6.4

Patch Changes

3.6.3

3.6.2

Patch Changes

3.6.1

Patch Changes

3.6.0

Patch Changes

  • #386 612bcdd Thanks @jnsdls! - [Gnosis Connector] - switch to safe.global hostname & add support for bsc and optimism chains

  • #364 7cb8e59 Thanks @joaquim-verges! - Add experimental useActiveClaimConditionForWallet() hook

3.5.2

Patch Changes

3.5.1

3.5.0

3.4.5

3.4.4

Patch Changes

3.4.3

Patch Changes

3.4.2

Patch Changes

3.4.1

Patch Changes

3.4.0

Minor Changes

  • #327 ef27aad Thanks @jnsdls! - Gnosis Safe and Magic Link connectors are no longer included in the default export. They are now available as named exports instead.

    Gnosis Safe

    Connector

    - import { GnosisSafeConnector } from "@thirdweb-dev/react";
    + import { GnosisSafeConnector } from "@thirdweb-dev/react/evm/connectors/gnosis-safe";

    Hook

    - import { useGnosis } from "@thirdweb-dev/react";
    + import { useGnosis } from "@thirdweb-dev/react/evm/connectors/gnosis-safe";

    Magic Link

    Connector

    - import { MagicLink } from "@thirdweb-dev/react";
    + import { MagicConnector } from "@thirdweb-dev/react/evm/connectors/magic";

    Hook

    - import { useMagic } from "@thirdweb-dev/react";
    + import { useMagic } from "@thirdweb-dev/react/evm/connectors/magic";

Patch Changes

3.3.1

3.3.0

3.2.6

Patch Changes

3.2.5

3.2.4

Patch Changes

3.2.3

Patch Changes

3.2.2

Patch Changes

3.2.1

Patch Changes

3.2.0

Patch Changes

  • #261 c8261b7 Thanks @jnsdls! - [EVM] - align behavior of useContract() and getContract() across react & sdk to both allow passing optional second params of contract types or ABIs

  • #236 cac373b Thanks @jnsdls! - [SOL] - do not require a connection, instead handle a network directly

  • #251 ea41231 Thanks @jnsdls! - fix missing Buffer implementation for WalletConnect and CoinbaseWallet connectors

  • #253 b6fc298 Thanks @jnsdls! - [EVM] - allow passing contractType as second param to useContract()

  • #243 1136d95 Thanks @jnsdls! - fix persister logic

  • #258 ac232b5 Thanks @nachoiacovino! - Accept SmartContract instead of erc20 instance

  • #245 1972f3e Thanks @jnsdls! - [SOL] - expose useBurnNFT hook

  • #255 9b92697 Thanks @jnsdls! - [EVM] - useContract() and <Web3Button /> can now accept an optional ABI directly and will return a SmartContract based on it

3.1.2

Patch Changes

3.1.1

Patch Changes

3.1.0

Minor Changes

Patch Changes

3.0.8

Patch Changes

3.0.7

Patch Changes

3.0.6

Patch Changes

3.0.5

Patch Changes

3.0.4

Patch Changes

3.0.3

Patch Changes

3.0.2

Patch Changes

3.0.1

Patch Changes

3.0.0

Major Changes

  • #19 82627ea Thanks @joaquim-verges! - 3.0.0 update

    MAJOR VERSION CHANGE

    • 85% reduction in package size!
    • Custom contracts are now first class citizens

    Full changelog

    Breaking changes:

    1. Hooks now accept custom contracts direclty and handle the logic internally

    before

    const { contract } = useContract(...)
    const { data: nfts } = useNFTs(contract?.nft)
    const { mutation: claim } = useClaimNFT(contract?.nft)

    after

    const { contract } = useContract(...)
    // works with any ERC721/ERC1155 contract
    const { data: nfts} = useNFTs(contract)
    const { mutation: claim } = useClaimNFT(contract)
    1. Custom contract hooks for reading and writing have been renamed:

    before

    const { contract } = useContract(...)
    const { data } = useContractData(contract, "myReadFunction", ...args);
    const { mutate: myFunction } = useContractCall(contract, "myWriteFunction");

    after

    const { contract } = useContract(...)
    const { data } = useContractRead(contract, "myReadFunction", ...args);
    const { mutate: myFunction } = useContractWrite(contract, "myWriteFunction");
    1. Web3Button benefits from the new Extension detection API:

    before

    <Web3Button
      contractAddress={...}
      action={(contract) => contract.nft?.drop?.claim?.to(...)}
      >
      Claim
      </Web3Button>

    after

    <Web3Button
      contractAddress={...}
      action={(contract) => contract.erc721.claim(...) }
      >
      Claim
      </Web3Button>

Minor Changes

  • #106 0fa6f3f Thanks @jnsdls! - switch all contracts to a new, universal useContract() hook

Patch Changes

2.9.7

Patch Changes

2.9.6

Patch Changes

2.9.5

Patch Changes

2.9.4

Patch Changes

2.9.3

Patch Changes

2.9.2

Patch Changes

2.9.1

Patch Changes

2.9.0

Minor Changes

  • #42 46ad691 Thanks @jnsdls! - remove functionName + params option from <Web3Button> - use action={...} instead

Patch Changes

2.8.1

Patch Changes

2.8.0

Minor Changes

  • 3abe26c: initialze monorepo packages

Patch Changes

2.7.5

Patch Changes

  • d0a7368: mark old contract hooks as deprecated (use useContract() instead)
  • d4abb09: Add support for Binance chains (BSC)
  • 86e3b58: use storage helpers from @thirdweb-dev/storage
  • cb439a9: useTotalCount always returns unclaimed and claimed tokens
  • 7fa920e: <Web3Button /> now accepts action instead of callable
  • Updated dependencies [d4abb09]
  • Updated dependencies [274afb5]
  • Updated dependencies [86e3b58]
  • Updated dependencies [86e3b58]
  • Updated dependencies [0c78b16]